var MS=Object.create;var gl=Object.defineProperty,RS=Object.defineProperties,PS=Object.getOwnPropertyDescriptor,NS=Object.getOwnPropertyDescriptors,kS=Object.getOwnPropertyNames,Eb=Object.getOwnPropertySymbols,Ab=Object.getPrototypeOf,Db=Object.prototype.hasOwnProperty,OS=Object.prototype.propertyIsEnumerable,LS=Reflect.get;var qh=(n,e)=>(e=Symbol[n])?e:Symbol.for("Symbol."+n);var Cb=(n,e,t)=>e in n?gl(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,x=(n,e)=>{for(var t in e||={})Db.call(e,t)&&Cb(n,t,e[t]);if(Eb)for(var t of Eb(e))OS.call(e,t)&&Cb(n,t,e[t]);return n},G=(n,e)=>RS(n,NS(e));var FS=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Sb=(n,e)=>{for(var t in e)gl(n,t,{get:e[t],enumerable:!0})},VS=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of kS(e))!Db.call(n,r)&&r!==t&&gl(n,r,{get:()=>e[r],enumerable:!(i=PS(e,r))||i.enumerable});return n};var jS=(n,e,t)=>(t=n!=null?MS(Ab(n)):{},VS(e||!n||!n.__esModule?gl(t,"default",{value:n,enumerable:!0}):t,n));var zr=(n,e,t)=>LS(Ab(n),t,e);var A=(n,e,t)=>new Promise((i,r)=>{var s=l=>{try{a(t.next(l))}catch(c){r(c)}},o=l=>{try{a(t.throw(l))}catch(c){r(c)}},a=l=>l.done?i(l.value):Promise.resolve(l.value).then(s,o);a((t=t.apply(n,e)).next())}),ml=function(n,e){this[0]=n,this[1]=e},Yh=(n,e,t)=>{var i=(o,a,l,c)=>{try{var u=t[o](a),d=(a=u.value)instanceof ml,h=u.done;Promise.resolve(d?a[0]:a).then(f=>d?i(o==="return"?o:"next",a[1]?{done:f.done,value:f.value}:f,l,c):l({value:f,done:h})).catch(f=>i("throw",f,l,c))}catch(f){c(f)}},r=o=>s[o]=a=>new Promise((l,c)=>i(o,a,l,c)),s={};return t=t.apply(n,e),s[qh("asyncIterator")]=()=>s,r("next"),r("throw"),r("return"),s};var xb=(n,e,t)=>(e=n[qh("asyncIterator")])?e.call(n):(n=n[qh("iterator")](),e={},t=(i,r)=>(r=n[i])&&(e[i]=s=>new Promise((o,a,l)=>(s=r.call(n,s),l=s.done,Promise.resolve(s.value).then(c=>o({value:c,done:l}),a)))),t("next"),t("return"),e);var _S=FS((wb,_b)=>{"use strict";(function(n,e){typeof define=="function"&&define.amd?define([],e):typeof wb<"u"?e():(e(),n.FileSaver={})})(wb,function(){"use strict";function n(a,l){return typeof l>"u"?l={autoBom:!1}:typeof l!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),l={autoBom:!l}),l.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a}function e(a,l,c){var u=new XMLHttpRequest;u.open("GET",a),u.responseType="blob",u.onload=function(){o(u.response,l,c)},u.onerror=function(){console.error("could not download file")},u.send()}function t(a){var l=new XMLHttpRequest;l.open("HEAD",a,!1);try{l.send()}catch{}return 200<=l.status&&299>=l.status}function i(a){try{a.dispatchEvent(new MouseEvent("click"))}catch{var l=document.createEvent("MouseEvents");l.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),a.dispatchEvent(l)}}var r=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:void 0,s=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),o=r.saveAs||(typeof window!="object"||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(a,l,c){var u=r.URL||r.webkitURL,d=document.createElement("a");l=l||a.name||"download",d.download=l,d.rel="noopener",typeof a=="string"?(d.href=a,d.origin===location.origin?i(d):t(d.href)?e(a,l,c):i(d,d.target="_blank")):(d.href=u.createObjectURL(a),setTimeout(function(){u.revokeObjectURL(d.href)},4e4),setTimeout(function(){i(d)},0))}:"msSaveOrOpenBlob"in navigator?function(a,l,c){if(l=l||a.name||"download",typeof a!="string")navigator.msSaveOrOpenBlob(n(a,c),l);else if(t(a))e(a,l,c);else{var u=document.createElement("a");u.href=a,u.target="_blank",setTimeout(function(){i(u)})}}:function(a,l,c,u){if(u=u||open("","_blank"),u&&(u.document.title=u.document.body.innerText="downloading..."),typeof a=="string")return e(a,l,c);var d=a.type==="application/octet-stream",h=/constructor/i.test(r.HTMLElement)||r.safari,f=/CriOS\/[\d]+/.test(navigator.userAgent);if((f||d&&h||s)&&typeof FileReader<"u"){var p=new FileReader;p.onloadend=function(){var m=p.result;m=f?m:m.replace(/^data:[^;]*;/,"data:attachment/file;"),u?u.location.href=m:location=m,u=null},p.readAsDataURL(a)}else{var g=r.URL||r.webkitURL,v=g.createObjectURL(a);u?u.location=v:location.href=v,u=null,setTimeout(function(){g.revokeObjectURL(v)},4e4)}});r.saveAs=o.saveAs=o,typeof _b<"u"&&(_b.exports=o)})});function Qh(n,e){return Object.is(n,e)}var Je=null,vl=!1,Jh=1,nn=Symbol("SIGNAL");function Z(n){let e=Je;return Je=n,e}function ef(){return Je}var Wr={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,kind:"unknown",producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function ho(n){if(vl)throw new Error("");if(Je===null)return;Je.consumerOnSignalRead(n);let e=Je.nextProducerIndex++;if(El(Je),en.nextProducerIndex;)n.producerNode.pop(),n.producerLastReadVersion.pop(),n.producerIndexOfThis.pop()}}function wl(n){El(n);for(let e=0;e0}function El(n){n.producerNode??=[],n.producerIndexOfThis??=[],n.producerLastReadVersion??=[]}function Mb(n){n.liveConsumerNode??=[],n.liveConsumerIndexOfThis??=[]}function Rb(n){return n.producerNode!==void 0}function sf(n,e){let t=Object.create(US);t.computation=n,e!==void 0&&(t.equal=e);let i=()=>{if(tf(t),ho(t),t.value===yl)throw t.error;return t.value};return i[nn]=t,i}var Xh=Symbol("UNSET"),Kh=Symbol("COMPUTING"),yl=Symbol("ERRORED"),US=G(x({},Wr),{value:Xh,dirty:!0,error:null,equal:Qh,kind:"computed",producerMustRecompute(n){return n.value===Xh||n.value===Kh},producerRecomputeValue(n){if(n.value===Kh)throw new Error("Detected cycle in computations.");let e=n.value;n.value=Kh;let t=fo(n),i,r=!1;try{i=n.computation(),Z(null),r=e!==Xh&&e!==yl&&i!==yl&&n.equal(e,i)}catch(s){i=yl,n.error=s}finally{bl(n,t)}if(r){n.value=e;return}n.value=i,n.version++}});function HS(){throw new Error}var Pb=HS;function Nb(n){Pb(n)}function of(n){Pb=n}var $S=null;function af(n,e){let t=Object.create(Cl);t.value=n,e!==void 0&&(t.equal=e);let i=()=>(ho(t),t.value);return i[nn]=t,i}function go(n,e){rf()||Nb(n),n.equal(n.value,e)||(n.value=e,zS(n))}function lf(n,e){rf()||Nb(n),go(n,e(n.value))}var Cl=G(x({},Wr),{equal:Qh,value:void 0,kind:"signal"});function zS(n){n.version++,Ib(),nf(n),$S?.()}function cf(n){let e=Z(null);try{return n()}finally{Z(e)}}var uf;function mo(){return uf}function Gn(n){let e=uf;return uf=n,e}var Al=Symbol("NotFound");function $(n){return typeof n=="function"}function Gr(n){let t=n(i=>{Error.call(i),i.stack=new Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Dl=Gr(n=>function(t){n(this),this.message=t?`${t.length} errors occurred during unsubscription: ${t.map((i,r)=>`${r+1}) ${i.toString()}`).join(` `)}`:"",this.name="UnsubscriptionError",this.errors=t});function Ki(n,e){if(n){let t=n.indexOf(e);0<=t&&n.splice(t,1)}}var je=class n{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:t}=this;if(t)if(this._parentage=null,Array.isArray(t))for(let s of t)s.remove(this);else t.remove(this);let{initialTeardown:i}=this;if($(i))try{i()}catch(s){e=s instanceof Dl?s.errors:[s]}let{_finalizers:r}=this;if(r){this._finalizers=null;for(let s of r)try{kb(s)}catch(o){e=e??[],o instanceof Dl?e=[...e,...o.errors]:e.push(o)}}if(e)throw new Dl(e)}}add(e){var t;if(e&&e!==this)if(this.closed)kb(e);else{if(e instanceof n){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}}_hasParent(e){let{_parentage:t}=this;return t===e||Array.isArray(t)&&t.includes(e)}_addParent(e){let{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e}_removeParent(e){let{_parentage:t}=this;t===e?this._parentage=null:Array.isArray(t)&&Ki(t,e)}remove(e){let{_finalizers:t}=this;t&&Ki(t,e),e instanceof n&&e._removeParent(this)}};je.EMPTY=(()=>{let n=new je;return n.closed=!0,n})();var df=je.EMPTY;function Sl(n){return n instanceof je||n&&"closed"in n&&$(n.remove)&&$(n.add)&&$(n.unsubscribe)}function kb(n){$(n)?n():n.unsubscribe()}var fn={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var qr={setTimeout(n,e,...t){let{delegate:i}=qr;return i?.setTimeout?i.setTimeout(n,e,...t):setTimeout(n,e,...t)},clearTimeout(n){let{delegate:e}=qr;return(e?.clearTimeout||clearTimeout)(n)},delegate:void 0};function xl(n){qr.setTimeout(()=>{let{onUnhandledError:e}=fn;if(e)e(n);else throw n})}function vo(){}var Ob=hf("C",void 0,void 0);function Lb(n){return hf("E",void 0,n)}function Fb(n){return hf("N",n,void 0)}function hf(n,e,t){return{kind:n,value:e,error:t}}var Zi=null;function Yr(n){if(fn.useDeprecatedSynchronousErrorHandling){let e=!Zi;if(e&&(Zi={errorThrown:!1,error:null}),n(),e){let{errorThrown:t,error:i}=Zi;if(Zi=null,t)throw i}}else n()}function Vb(n){fn.useDeprecatedSynchronousErrorHandling&&Zi&&(Zi.errorThrown=!0,Zi.error=n)}var Qi=class extends je{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Sl(e)&&e.add(this)):this.destination=KS}static create(e,t,i){return new qn(e,t,i)}next(e){this.isStopped?pf(Fb(e),this):this._next(e)}error(e){this.isStopped?pf(Lb(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?pf(Ob,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},YS=Function.prototype.bind;function ff(n,e){return YS.call(n,e)}var gf=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:t}=this;if(t.next)try{t.next(e)}catch(i){Il(i)}}error(e){let{partialObserver:t}=this;if(t.error)try{t.error(e)}catch(i){Il(i)}else Il(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(t){Il(t)}}},qn=class extends Qi{constructor(e,t,i){super();let r;if($(e)||!e)r={next:e??void 0,error:t??void 0,complete:i??void 0};else{let s;this&&fn.useDeprecatedNextContext?(s=Object.create(e),s.unsubscribe=()=>this.unsubscribe(),r={next:e.next&&ff(e.next,s),error:e.error&&ff(e.error,s),complete:e.complete&&ff(e.complete,s)}):r=e}this.destination=new gf(r)}};function Il(n){fn.useDeprecatedSynchronousErrorHandling?Vb(n):xl(n)}function XS(n){throw n}function pf(n,e){let{onStoppedNotification:t}=fn;t&&qr.setTimeout(()=>t(n,e))}var KS={closed:!0,next:vo,error:XS,complete:vo};var Xr=typeof Symbol=="function"&&Symbol.observable||"@@observable";function Ut(n){return n}function mf(...n){return vf(n)}function vf(n){return n.length===0?Ut:n.length===1?n[0]:function(t){return n.reduce((i,r)=>r(i),t)}}var ce=(()=>{class n{constructor(t){t&&(this._subscribe=t)}lift(t){let i=new n;return i.source=this,i.operator=t,i}subscribe(t,i,r){let s=QS(t)?t:new qn(t,i,r);return Yr(()=>{let{operator:o,source:a}=this;s.add(o?o.call(s,a):a?this._subscribe(s):this._trySubscribe(s))}),s}_trySubscribe(t){try{return this._subscribe(t)}catch(i){t.error(i)}}forEach(t,i){return i=jb(i),new i((r,s)=>{let o=new qn({next:a=>{try{t(a)}catch(l){s(l),o.unsubscribe()}},error:s,complete:r});this.subscribe(o)})}_subscribe(t){var i;return(i=this.source)===null||i===void 0?void 0:i.subscribe(t)}[Xr](){return this}pipe(...t){return vf(t)(this)}toPromise(t){return t=jb(t),new t((i,r)=>{let s;this.subscribe(o=>s=o,o=>r(o),()=>i(s))})}}return n.create=e=>new n(e),n})();function jb(n){var e;return(e=n??fn.Promise)!==null&&e!==void 0?e:Promise}function ZS(n){return n&&$(n.next)&&$(n.error)&&$(n.complete)}function QS(n){return n&&n instanceof Qi||ZS(n)&&Sl(n)}function yf(n){return $(n?.lift)}function re(n){return e=>{if(yf(e))return e.lift(function(t){try{return n(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}function se(n,e,t,i,r){return new bf(n,e,t,i,r)}var bf=class extends Qi{constructor(e,t,i,r,s,o){super(e),this.onFinalize=s,this.shouldUnsubscribe=o,this._next=t?function(a){try{t(a)}catch(l){e.error(l)}}:super._next,this._error=r?function(a){try{r(a)}catch(l){e.error(l)}finally{this.unsubscribe()}}:super._error,this._complete=i?function(){try{i()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:t}=this;super.unsubscribe(),!t&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};function Kr(){return re((n,e)=>{let t=null;n._refCount++;let i=se(e,void 0,void 0,void 0,()=>{if(!n||n._refCount<=0||0<--n._refCount){t=null;return}let r=n._connection,s=t;t=null,r&&(!s||r===s)&&r.unsubscribe(),e.unsubscribe()});n.subscribe(i),i.closed||(t=n.connect())})}var Zr=class extends ce{constructor(e,t){super(),this.source=e,this.subjectFactory=t,this._subject=null,this._refCount=0,this._connection=null,yf(e)&&(this.lift=e.lift)}_subscribe(e){return this.getSubject().subscribe(e)}getSubject(){let e=this._subject;return(!e||e.isStopped)&&(this._subject=this.subjectFactory()),this._subject}_teardown(){this._refCount=0;let{_connection:e}=this;this._subject=this._connection=null,e?.unsubscribe()}connect(){let e=this._connection;if(!e){e=this._connection=new je;let t=this.getSubject();e.add(this.source.subscribe(se(t,void 0,()=>{this._teardown(),t.complete()},i=>{this._teardown(),t.error(i)},()=>this._teardown()))),e.closed&&(this._connection=null,e=je.EMPTY)}return e}refCount(){return Kr()(this)}};var Bb=Gr(n=>function(){n(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var Se=(()=>{class n extends ce{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){let i=new Tl(this,this);return i.operator=t,i}_throwIfClosed(){if(this.closed)throw new Bb}next(t){Yr(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let i of this.currentObservers)i.next(t)}})}error(t){Yr(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;let{observers:i}=this;for(;i.length;)i.shift().error(t)}})}complete(){Yr(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:t}=this;for(;t.length;)t.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return((t=this.observers)===null||t===void 0?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){let{hasError:i,isStopped:r,observers:s}=this;return i||r?df:(this.currentObservers=null,s.push(t),new je(()=>{this.currentObservers=null,Ki(s,t)}))}_checkFinalizedStatuses(t){let{hasError:i,thrownError:r,isStopped:s}=this;i?t.error(r):s&&t.complete()}asObservable(){let t=new ce;return t.source=this,t}}return n.create=(e,t)=>new Tl(e,t),n})(),Tl=class extends Se{constructor(e,t){super(),this.destination=e,this.source=t}next(e){var t,i;(i=(t=this.destination)===null||t===void 0?void 0:t.next)===null||i===void 0||i.call(t,e)}error(e){var t,i;(i=(t=this.destination)===null||t===void 0?void 0:t.error)===null||i===void 0||i.call(t,e)}complete(){var e,t;(t=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||t===void 0||t.call(e)}_subscribe(e){var t,i;return(i=(t=this.source)===null||t===void 0?void 0:t.subscribe(e))!==null&&i!==void 0?i:df}};var et=class extends Se{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let t=super._subscribe(e);return!t.closed&&e.next(this._value),t}getValue(){let{hasError:e,thrownError:t,_value:i}=this;if(e)throw t;return this._throwIfClosed(),i}next(e){super.next(this._value=e)}};var yo={now(){return(yo.delegate||Date).now()},delegate:void 0};var Ml=class extends Se{constructor(e=1/0,t=1/0,i=yo){super(),this._bufferSize=e,this._windowTime=t,this._timestampProvider=i,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=t===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,t)}next(e){let{isStopped:t,_buffer:i,_infiniteTimeWindow:r,_timestampProvider:s,_windowTime:o}=this;t||(i.push(e),!r&&i.push(s.now()+o)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let t=this._innerSubscribe(e),{_infiniteTimeWindow:i,_buffer:r}=this,s=r.slice();for(let o=0;on.complete());function Hb(n){return n&&$(n.schedule)}function $b(n){return n[n.length-1]}function kl(n){return $($b(n))?n.pop():void 0}function Si(n){return Hb($b(n))?n.pop():void 0}function Wb(n,e,t,i){function r(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(u){try{c(i.next(u))}catch(d){o(d)}}function l(u){try{c(i.throw(u))}catch(d){o(d)}}function c(u){u.done?s(u.value):r(u.value).then(a,l)}c((i=i.apply(n,e||[])).next())})}function zb(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],i=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&i>=n.length&&(n=void 0),{value:n&&n[i++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ji(n){return this instanceof Ji?(this.v=n,this):new Ji(n)}function Gb(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(n,e||[]),r,s=[];return r={},o("next"),o("throw"),o("return"),r[Symbol.asyncIterator]=function(){return this},r;function o(h){i[h]&&(r[h]=function(f){return new Promise(function(p,g){s.push([h,f,p,g])>1||a(h,f)})})}function a(h,f){try{l(i[h](f))}catch(p){d(s[0][3],p)}}function l(h){h.value instanceof Ji?Promise.resolve(h.value.v).then(c,u):d(s[0][2],h)}function c(h){a("next",h)}function u(h){a("throw",h)}function d(h,f){h(f),s.shift(),s.length&&a(s[0][0],s[0][1])}}function qb(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof zb=="function"?zb(n):n[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(s){t[s]=n[s]&&function(o){return new Promise(function(a,l){o=n[s](o),r(a,l,o.done,o.value)})}}function r(s,o,a,l){Promise.resolve(l).then(function(c){s({value:c,done:a})},o)}}var Jr=n=>n&&typeof n.length=="number"&&typeof n!="function";function Ol(n){return $(n?.then)}function Ll(n){return $(n[Xr])}function Fl(n){return Symbol.asyncIterator&&$(n?.[Symbol.asyncIterator])}function Vl(n){return new TypeError(`You provided ${n!==null&&typeof n=="object"?"an invalid object":`'${n}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function JS(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var jl=JS();function Bl(n){return $(n?.[jl])}function Ul(n){return Gb(this,arguments,function*(){let t=n.getReader();try{for(;;){let{value:i,done:r}=yield Ji(t.read());if(r)return yield Ji(void 0);yield yield Ji(i)}}finally{t.releaseLock()}})}function Hl(n){return $(n?.getReader)}function Me(n){if(n instanceof ce)return n;if(n!=null){if(Ll(n))return ex(n);if(Jr(n))return tx(n);if(Ol(n))return nx(n);if(Fl(n))return Yb(n);if(Bl(n))return ix(n);if(Hl(n))return rx(n)}throw Vl(n)}function ex(n){return new ce(e=>{let t=n[Xr]();if($(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function tx(n){return new ce(e=>{for(let t=0;t{n.then(t=>{e.closed||(e.next(t),e.complete())},t=>e.error(t)).then(null,xl)})}function ix(n){return new ce(e=>{for(let t of n)if(e.next(t),e.closed)return;e.complete()})}function Yb(n){return new ce(e=>{sx(n,e).catch(t=>e.error(t))})}function rx(n){return Yb(Ul(n))}function sx(n,e){var t,i,r,s;return Wb(this,void 0,void 0,function*(){try{for(t=qb(n);i=yield t.next(),!i.done;){let o=i.value;if(e.next(o),e.closed)return}}catch(o){r={error:o}}finally{try{i&&!i.done&&(s=t.return)&&(yield s.call(t))}finally{if(r)throw r.error}}e.complete()})}function Mt(n,e,t,i=0,r=!1){let s=e.schedule(function(){t(),r?n.add(this.schedule(null,i)):this.unsubscribe()},i);if(n.add(s),!r)return s}function $l(n,e=0){return re((t,i)=>{t.subscribe(se(i,r=>Mt(i,n,()=>i.next(r),e),()=>Mt(i,n,()=>i.complete(),e),r=>Mt(i,n,()=>i.error(r),e)))})}function zl(n,e=0){return re((t,i)=>{i.add(n.schedule(()=>t.subscribe(i),e))})}function Xb(n,e){return Me(n).pipe(zl(e),$l(e))}function Kb(n,e){return Me(n).pipe(zl(e),$l(e))}function Zb(n,e){return new ce(t=>{let i=0;return e.schedule(function(){i===n.length?t.complete():(t.next(n[i++]),t.closed||this.schedule())})})}function Qb(n,e){return new ce(t=>{let i;return Mt(t,e,()=>{i=n[jl](),Mt(t,e,()=>{let r,s;try{({value:r,done:s}=i.next())}catch(o){t.error(o);return}s?t.complete():t.next(r)},0,!0)}),()=>$(i?.return)&&i.return()})}function Wl(n,e){if(!n)throw new Error("Iterable cannot be null");return new ce(t=>{Mt(t,e,()=>{let i=n[Symbol.asyncIterator]();Mt(t,e,()=>{i.next().then(r=>{r.done?t.complete():t.next(r.value)})},0,!0)})})}function Jb(n,e){return Wl(Ul(n),e)}function ew(n,e){if(n!=null){if(Ll(n))return Xb(n,e);if(Jr(n))return Zb(n,e);if(Ol(n))return Kb(n,e);if(Fl(n))return Wl(n,e);if(Bl(n))return Qb(n,e);if(Hl(n))return Jb(n,e)}throw Vl(n)}function Ae(n,e){return e?ew(n,e):Me(n)}function U(...n){let e=Si(n);return Ae(n,e)}function xi(n,e){let t=$(n)?n:()=>n,i=r=>r.error(t());return new ce(e?r=>e.schedule(i,0,r):i)}function Yn(n){return!!n&&(n instanceof ce||$(n.lift)&&$(n.subscribe))}var Xn=Gr(n=>function(){n(this),this.name="EmptyError",this.message="no elements in sequence"});function z(n,e){return re((t,i)=>{let r=0;t.subscribe(se(i,s=>{i.next(n.call(e,s,r++))}))})}var{isArray:ox}=Array;function ax(n,e){return ox(e)?n(...e):n(e)}function es(n){return z(e=>ax(n,e))}var{isArray:lx}=Array,{getPrototypeOf:cx,prototype:ux,keys:dx}=Object;function Gl(n){if(n.length===1){let e=n[0];if(lx(e))return{args:e,keys:null};if(hx(e)){let t=dx(e);return{args:t.map(i=>e[i]),keys:t}}}return{args:n,keys:null}}function hx(n){return n&&typeof n=="object"&&cx(n)===ux}function ql(n,e){return n.reduce((t,i,r)=>(t[i]=e[r],t),{})}function Yl(...n){let e=Si(n),t=kl(n),{args:i,keys:r}=Gl(n);if(i.length===0)return Ae([],e);let s=new ce(fx(i,e,r?o=>ql(r,o):Ut));return t?s.pipe(es(t)):s}function fx(n,e,t=Ut){return i=>{tw(e,()=>{let{length:r}=n,s=new Array(r),o=r,a=r;for(let l=0;l{let c=Ae(n[l],e),u=!1;c.subscribe(se(i,d=>{s[l]=d,u||(u=!0,a--),a||i.next(t(s.slice()))},()=>{--o||i.complete()}))},i)},i)}}function tw(n,e,t){n?Mt(t,n,e):e()}function nw(n,e,t,i,r,s,o,a){let l=[],c=0,u=0,d=!1,h=()=>{d&&!l.length&&!c&&e.complete()},f=g=>c{s&&e.next(g),c++;let v=!1;Me(t(g,u++)).subscribe(se(e,m=>{r?.(m),s?f(m):e.next(m)},()=>{v=!0},void 0,()=>{if(v)try{for(c--;l.length&&cp(m)):p(m)}h()}catch(m){e.error(m)}}))};return n.subscribe(se(e,f,()=>{d=!0,h()})),()=>{a?.()}}function He(n,e,t=1/0){return $(e)?He((i,r)=>z((s,o)=>e(i,s,r,o))(Me(n(i,r))),t):(typeof e=="number"&&(t=e),re((i,r)=>nw(i,r,n,t)))}function iw(n=1/0){return He(Ut,n)}function rw(){return iw(1)}function Kn(...n){return rw()(Ae(n,Si(n)))}function er(n){return new ce(e=>{Me(n()).subscribe(e)})}function wo(...n){let e=kl(n),{args:t,keys:i}=Gl(n),r=new ce(s=>{let{length:o}=t;if(!o){s.complete();return}let a=new Array(o),l=o,c=o;for(let u=0;u{d||(d=!0,c--),a[u]=h},()=>l--,void 0,()=>{(!l||!d)&&(c||s.next(i?ql(i,a):a),s.complete())}))}});return e?r.pipe(es(e)):r}var px=["addListener","removeListener"],gx=["addEventListener","removeEventListener"],mx=["on","off"];function ke(n,e,t,i){if($(t)&&(i=t,t=void 0),i)return ke(n,e,t).pipe(es(i));let[r,s]=bx(n)?gx.map(o=>a=>n[o](e,a,t)):vx(n)?px.map(sw(n,e)):yx(n)?mx.map(sw(n,e)):[];if(!r&&Jr(n))return He(o=>ke(o,e,t))(Me(n));if(!r)throw new TypeError("Invalid event target");return new ce(o=>{let a=(...l)=>o.next(1s(a)})}function sw(n,e){return t=>i=>n[t](e,i)}function vx(n){return $(n.addListener)&&$(n.removeListener)}function yx(n){return $(n.on)&&$(n.off)}function bx(n){return $(n.addEventListener)&&$(n.removeEventListener)}function At(n,e){return re((t,i)=>{let r=0;t.subscribe(se(i,s=>n.call(e,s,r++)&&i.next(s)))})}function st(n){return re((e,t)=>{let i=null,r=!1,s;i=e.subscribe(se(t,void 0,void 0,o=>{s=Me(n(o,st(n)(e))),i?(i.unsubscribe(),i=null,s.subscribe(t)):r=!0})),r&&(i.unsubscribe(),i=null,s.subscribe(t))})}function ow(n,e,t,i,r){return(s,o)=>{let a=t,l=e,c=0;s.subscribe(se(o,u=>{let d=c++;l=a?n(l,u,d):(a=!0,u),i&&o.next(l)},r&&(()=>{a&&o.next(l),o.complete()})))}}function xn(n,e){return $(e)?He(n,e,1):He(n,1)}function wf(n,e=Ub){return re((t,i)=>{let r=null,s=null,o=null,a=()=>{if(r){r.unsubscribe(),r=null;let c=s;s=null,i.next(c)}};function l(){let c=o+n,u=e.now();if(u{s=c,o=e.now(),r||(r=e.schedule(l,n),i.add(r))},()=>{a(),i.complete()},void 0,()=>{s=r=null}))})}function Ii(n){return re((e,t)=>{let i=!1;e.subscribe(se(t,r=>{i=!0,t.next(r)},()=>{i||t.next(n),t.complete()}))})}function Rt(n){return n<=0?()=>Tt:re((e,t)=>{let i=0;e.subscribe(se(t,r=>{++i<=n&&(t.next(r),n<=i&&t.complete())}))})}function Xl(n=wx){return re((e,t)=>{let i=!1;e.subscribe(se(t,r=>{i=!0,t.next(r)},()=>i?t.complete():t.error(n())))})}function wx(){return new Xn}function tr(n){return re((e,t)=>{try{e.subscribe(t)}finally{t.add(n)}})}function Zn(n,e){let t=arguments.length>=2;return i=>i.pipe(n?At((r,s)=>n(r,s,i)):Ut,Rt(1),t?Ii(e):Xl(()=>new Xn))}function ts(n){return n<=0?()=>Tt:re((e,t)=>{let i=[];e.subscribe(se(t,r=>{i.push(r),n{for(let r of i)t.next(r);t.complete()},void 0,()=>{i=null}))})}function _f(n,e){let t=arguments.length>=2;return i=>i.pipe(n?At((r,s)=>n(r,s,i)):Ut,ts(1),t?Ii(e):Xl(()=>new Xn))}function Ef(n,e){return re(ow(n,e,arguments.length>=2,!0))}function aw(n={}){let{connector:e=()=>new Se,resetOnError:t=!0,resetOnComplete:i=!0,resetOnRefCountZero:r=!0}=n;return s=>{let o,a,l,c=0,u=!1,d=!1,h=()=>{a?.unsubscribe(),a=void 0},f=()=>{h(),o=l=void 0,u=d=!1},p=()=>{let g=o;f(),g?.unsubscribe()};return re((g,v)=>{c++,!d&&!u&&h();let m=l=l??e();v.add(()=>{c--,c===0&&!d&&!u&&(a=Cf(p,r))}),m.subscribe(v),!o&&c>0&&(o=new qn({next:y=>m.next(y),error:y=>{d=!0,h(),a=Cf(f,t,y),m.error(y)},complete:()=>{u=!0,h(),a=Cf(f,i),m.complete()}}),Me(g).subscribe(o))})(s)}}function Cf(n,e,...t){if(e===!0){n();return}if(e===!1)return;let i=new qn({next:()=>{i.unsubscribe(),n()}});return Me(e(...t)).subscribe(i)}function Kl(n,e,t){let i,r=!1;return n&&typeof n=="object"?{bufferSize:i=1/0,windowTime:e=1/0,refCount:r=!1,scheduler:t}=n:i=n??1/0,aw({connector:()=>new Ml(i,e,t),resetOnError:!0,resetOnComplete:!1,resetOnRefCountZero:r})}function Af(...n){let e=Si(n);return re((t,i)=>{(e?Kn(n,t,e):Kn(n,t)).subscribe(i)})}function gt(n,e){return re((t,i)=>{let r=null,s=0,o=!1,a=()=>o&&!r&&i.complete();t.subscribe(se(i,l=>{r?.unsubscribe();let c=0,u=s++;Me(n(l,u)).subscribe(r=se(i,d=>i.next(e?e(l,d,u,c++):d),()=>{r=null,a()}))},()=>{o=!0,a()}))})}function xe(n){return re((e,t)=>{Me(n).subscribe(se(t,()=>t.complete(),vo)),!t.closed&&e.subscribe(t)})}function Xe(n,e,t){let i=$(n)||e||t?{next:n,error:e,complete:t}:n;return i?re((r,s)=>{var o;(o=i.subscribe)===null||o===void 0||o.call(i);let a=!0;r.subscribe(se(s,l=>{var c;(c=i.next)===null||c===void 0||c.call(i,l),s.next(l)},()=>{var l;a=!1,(l=i.complete)===null||l===void 0||l.call(i),s.complete()},l=>{var c;a=!1,(c=i.error)===null||c===void 0||c.call(i,l),s.error(l)},()=>{var l,c;a&&((l=i.unsubscribe)===null||l===void 0||l.call(i)),(c=i.finalize)===null||c===void 0||c.call(i)}))}):Ut}var Jw="https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss",O=class extends Error{code;constructor(e,t){super(e_(e,t)),this.code=e}};function _x(n){return`NG0${Math.abs(n)}`}function e_(n,e){return`${_x(n)}${e?": "+e:""}`}var t_=Symbol("InputSignalNode#UNSET"),Ex=G(x({},Cl),{transformFn:void 0,applyValueToInputSignal(n,e){go(n,e)}});function n_(n,e){let t=Object.create(Ex);t.value=n,t.transformFn=e?.transform;function i(){if(ho(t),t.value===t_){let r=null;throw new O(-950,r)}return t.value}return i[nn]=t,i}function Oo(n){return{toString:n}.toString()}var Zl="__parameters__";function Cx(n){return function(...t){if(n){let i=n(...t);for(let r in i)this[r]=i[r]}}}function i_(n,e,t){return Oo(()=>{let i=Cx(e);function r(...s){if(this instanceof r)return i.apply(this,s),this;let o=new r(...s);return a.annotation=o,a;function a(l,c,u){let d=l.hasOwnProperty(Zl)?l[Zl]:Object.defineProperty(l,Zl,{value:[]})[Zl];for(;d.length<=u;)d.push(null);return(d[u]=d[u]||[]).push(o),l}}return r.prototype.ngMetadataName=n,r.annotationCls=r,r})}var Qn=globalThis;function De(n){for(let e in n)if(n[e]===De)return e;throw Error("Could not find renamed property on target object.")}function Ax(n,e){for(let t in e)e.hasOwnProperty(t)&&!n.hasOwnProperty(t)&&(n[t]=e[t])}function Nt(n){if(typeof n=="string")return n;if(Array.isArray(n))return`[${n.map(Nt).join(", ")}]`;if(n==null)return""+n;let e=n.overriddenName||n.name;if(e)return`${e}`;let t=n.toString();if(t==null)return""+t;let i=t.indexOf(` `);return i>=0?t.slice(0,i):t}function lw(n,e){return n?e?`${n} ${e}`:n:e||""}var Dx=De({__forward_ref__:De});function ni(n){return n.__forward_ref__=ni,n.toString=function(){return Nt(this())},n}function Dt(n){return r_(n)?n():n}function r_(n){return typeof n=="function"&&n.hasOwnProperty(Dx)&&n.__forward_ref__===ni}function P(n){return{token:n.token,providedIn:n.providedIn||null,factory:n.factory,value:void 0}}function $t(n){return{providers:n.providers||[],imports:n.imports||[]}}function Oc(n){return cw(n,o_)||cw(n,a_)}function s_(n){return Oc(n)!==null}function cw(n,e){return n.hasOwnProperty(e)?n[e]:null}function Sx(n){let e=n&&(n[o_]||n[a_]);return e||null}function uw(n){return n&&(n.hasOwnProperty(dw)||n.hasOwnProperty(xx))?n[dw]:null}var o_=De({\u0275prov:De}),dw=De({\u0275inj:De}),a_=De({ngInjectableDef:De}),xx=De({ngInjectorDef:De}),L=class{_desc;ngMetadataName="InjectionToken";\u0275prov;constructor(e,t){this._desc=e,this.\u0275prov=void 0,typeof t=="number"?this.__NG_ELEMENT_ID__=t:t!==void 0&&(this.\u0275prov=P({token:this,providedIn:t.providedIn||"root",factory:t.factory}))}get multi(){return this}toString(){return`InjectionToken ${this._desc}`}};function l_(n){return n&&!!n.\u0275providers}var Ix=De({\u0275cmp:De}),Tx=De({\u0275dir:De}),Mx=De({\u0275pipe:De}),Rx=De({\u0275mod:De}),lc=De({\u0275fac:De}),Ao=De({__NG_ELEMENT_ID__:De}),hw=De({__NG_ENV_ID__:De});function Lo(n){return typeof n=="string"?n:n==null?"":String(n)}function Px(n){return typeof n=="function"?n.name||n.toString():typeof n=="object"&&n!=null&&typeof n.type=="function"?n.type.name||n.type.toString():Lo(n)}function c_(n,e){throw new O(-200,n)}function $p(n,e){throw new O(-201,!1)}var J=function(n){return n[n.Default=0]="Default",n[n.Host=1]="Host",n[n.Self=2]="Self",n[n.SkipSelf=4]="SkipSelf",n[n.Optional=8]="Optional",n}(J||{}),Uf;function u_(){return Uf}function Pt(n){let e=Uf;return Uf=n,e}function d_(n,e,t){let i=Oc(n);if(i&&i.providedIn=="root")return i.value===void 0?i.value=i.factory():i.value;if(t&J.Optional)return null;if(e!==void 0)return e;$p(n,"Injector")}var Nx={},ir=Nx,Hf="__NG_DI_FLAG__",cc=class{injector;constructor(e){this.injector=e}retrieve(e,t){let i=t;return this.injector.get(e,i.optional?Al:ir,i)}},uc="ngTempTokenPath",kx="ngTokenPath",Ox=/\n/gm,Lx="\u0275",fw="__source";function Fx(n,e=J.Default){if(mo()===void 0)throw new O(-203,!1);if(mo()===null)return d_(n,void 0,e);{let t=mo(),i;return t instanceof cc?i=t.injector:i=t,i.get(n,e&J.Optional?null:void 0,e)}}function F(n,e=J.Default){return(u_()||Fx)(Dt(n),e)}function T(n,e=J.Default){return F(n,Lc(e))}function Lc(n){return typeof n>"u"||typeof n=="number"?n:0|(n.optional&&8)|(n.host&&1)|(n.self&&2)|(n.skipSelf&&4)}function $f(n){let e=[];for(let t=0;t ");else if(typeof e=="object"){let s=[];for(let o in e)if(e.hasOwnProperty(o)){let a=e[o];s.push(o+":"+(typeof a=="string"?JSON.stringify(a):Nt(a)))}r=`{${s.join(", ")}}`}return`${t}${i?"("+i+")":""}[${r}]: ${n.replace(Ox,` `)}`}var Ux=h_(i_("Optional"),8);var Hx=h_(i_("SkipSelf"),4);function sr(n,e){let t=n.hasOwnProperty(lc);return t?n[lc]:null}function $x(n,e,t){if(n.length!==e.length)return!1;for(let i=0;iArray.isArray(t)?zp(t,e):e(t))}function f_(n,e,t){e>=n.length?n.push(t):n.splice(e,0,t)}function dc(n,e){return e>=n.length-1?n.pop():n.splice(e,1)[0]}function Wx(n,e){let t=[];for(let i=0;ie;){let s=r-2;n[r]=n[s],r--}n[e]=t,n[e+1]=i}}function qx(n,e,t){let i=Fo(n,e);return i>=0?n[i|1]=t:(i=~i,Gx(n,i,e,t)),i}function Df(n,e){let t=Fo(n,e);if(t>=0)return n[t|1]}function Fo(n,e){return Yx(n,e,1)}function Yx(n,e,t){let i=0,r=n.length>>t;for(;r!==i;){let s=i+(r-i>>1),o=n[s<e?r=s:i=s+1}return~(r<{t.push(o)};return zp(e,o=>{let a=o;zf(a,s,[],i)&&(r||=[],r.push(a))}),r!==void 0&&y_(r,s),t}function y_(n,e){for(let t=0;t{e(s,i)})}}function zf(n,e,t,i){if(n=Dt(n),!n)return!1;let r=null,s=uw(n),o=!s&&os(n);if(!s&&!o){let l=n.ngModule;if(s=uw(l),s)r=l;else return!1}else{if(o&&!o.standalone)return!1;r=n}let a=i.has(r);if(o){if(a)return!1;if(i.add(r),o.dependencies){let l=typeof o.dependencies=="function"?o.dependencies():o.dependencies;for(let c of l)zf(c,e,t,i)}}else if(s){if(s.imports!=null&&!a){i.add(r);let c;try{zp(s.imports,u=>{zf(u,e,t,i)&&(c||=[],c.push(u))})}finally{}c!==void 0&&y_(c,e)}if(!a){let c=sr(r)||(()=>new r);e({provide:r,useFactory:c,deps:rn},r),e({provide:g_,useValue:r,multi:!0},r),e({provide:Do,useValue:()=>F(r),multi:!0},r)}let l=s.providers;if(l!=null&&!a){let c=n;Wp(l,u=>{e(u,c)})}}else return!1;return r!==n&&n.providers!==void 0}function Wp(n,e){for(let t of n)l_(t)&&(t=t.\u0275providers),Array.isArray(t)?Wp(t,e):e(t)}var Qx=De({provide:String,useValue:De});function b_(n){return n!==null&&typeof n=="object"&&Qx in n}function Jx(n){return!!(n&&n.useExisting)}function eI(n){return!!(n&&n.useFactory)}function as(n){return typeof n=="function"}function tI(n){return!!n.useClass}var Fc=new L(""),nc={},pw={},Sf;function Gp(){return Sf===void 0&&(Sf=new hc),Sf}var kt=class{},So=class extends kt{parent;source;scopes;records=new Map;_ngOnDestroyHooks=new Set;_onDestroyHooks=[];get destroyed(){return this._destroyed}_destroyed=!1;injectorDefTypes;constructor(e,t,i,r){super(),this.parent=t,this.source=i,this.scopes=r,Gf(e,o=>this.processProvider(o)),this.records.set(p_,ns(void 0,this)),r.has("environment")&&this.records.set(kt,ns(void 0,this));let s=this.records.get(Fc);s!=null&&typeof s.value=="string"&&this.scopes.add(s.value),this.injectorDefTypes=new Set(this.get(g_,rn,J.Self))}retrieve(e,t){let i=t;return this.get(e,i.optional?Al:ir,i)}destroy(){Eo(this),this._destroyed=!0;let e=Z(null);try{for(let i of this._ngOnDestroyHooks)i.ngOnDestroy();let t=this._onDestroyHooks;this._onDestroyHooks=[];for(let i of t)i()}finally{this.records.clear(),this._ngOnDestroyHooks.clear(),this.injectorDefTypes.clear(),Z(e)}}onDestroy(e){return Eo(this),this._onDestroyHooks.push(e),()=>this.removeOnDestroy(e)}runInContext(e){Eo(this);let t=Gn(this),i=Pt(void 0),r;try{return e()}finally{Gn(t),Pt(i)}}get(e,t=ir,i=J.Default){if(Eo(this),e.hasOwnProperty(hw))return e[hw](this);i=Lc(i);let r,s=Gn(this),o=Pt(void 0);try{if(!(i&J.SkipSelf)){let l=this.records.get(e);if(l===void 0){let c=oI(e)&&Oc(e);c&&this.injectableDefInScope(c)?l=ns(Wf(e),nc):l=null,this.records.set(e,l)}if(l!=null)return this.hydrate(e,l,i)}let a=i&J.Self?Gp():this.parent;return t=i&J.Optional&&t===ir?null:t,a.get(e,t)}catch(a){if(a.name==="NullInjectorError"){if((a[uc]=a[uc]||[]).unshift(Nt(e)),s)throw a;return jx(a,e,"R3InjectorError",this.source)}else throw a}finally{Pt(o),Gn(s)}}resolveInjectorInitializers(){let e=Z(null),t=Gn(this),i=Pt(void 0),r;try{let s=this.get(Do,rn,J.Self);for(let o of s)o()}finally{Gn(t),Pt(i),Z(e)}}toString(){let e=[],t=this.records;for(let i of t.keys())e.push(Nt(i));return`R3Injector[${e.join(", ")}]`}processProvider(e){e=Dt(e);let t=as(e)?e:Dt(e&&e.provide),i=iI(e);if(!as(e)&&e.multi===!0){let r=this.records.get(t);r||(r=ns(void 0,nc,!0),r.factory=()=>$f(r.multi),this.records.set(t,r)),t=e,r.multi.push(e)}this.records.set(t,i)}hydrate(e,t,i){let r=Z(null);try{return t.value===pw?c_(Nt(e)):t.value===nc&&(t.value=pw,t.value=t.factory(void 0,i)),typeof t.value=="object"&&t.value&&sI(t.value)&&this._ngOnDestroyHooks.add(t.value),t.value}finally{Z(r)}}injectableDefInScope(e){if(!e.providedIn)return!1;let t=Dt(e.providedIn);return typeof t=="string"?t==="any"||this.scopes.has(t):this.injectorDefTypes.has(t)}removeOnDestroy(e){let t=this._onDestroyHooks.indexOf(e);t!==-1&&this._onDestroyHooks.splice(t,1)}};function Wf(n){let e=Oc(n),t=e!==null?e.factory:sr(n);if(t!==null)return t;if(n instanceof L)throw new O(204,!1);if(n instanceof Function)return nI(n);throw new O(204,!1)}function nI(n){if(n.length>0)throw new O(204,!1);let t=Sx(n);return t!==null?()=>t.factory(n):()=>new n}function iI(n){if(b_(n))return ns(void 0,n.useValue);{let e=w_(n);return ns(e,nc)}}function w_(n,e,t){let i;if(as(n)){let r=Dt(n);return sr(r)||Wf(r)}else if(b_(n))i=()=>Dt(n.useValue);else if(eI(n))i=()=>n.useFactory(...$f(n.deps||[]));else if(Jx(n))i=(r,s)=>F(Dt(n.useExisting),s!==void 0&&s&J.Optional?J.Optional:void 0);else{let r=Dt(n&&(n.useClass||n.provide));if(rI(n))i=()=>new r(...$f(n.deps));else return sr(r)||Wf(r)}return i}function Eo(n){if(n.destroyed)throw new O(205,!1)}function ns(n,e,t=!1){return{factory:n,value:e,multi:t?[]:void 0}}function rI(n){return!!n.deps}function sI(n){return n!==null&&typeof n=="object"&&typeof n.ngOnDestroy=="function"}function oI(n){return typeof n=="function"||typeof n=="object"&&n instanceof L}function Gf(n,e){for(let t of n)Array.isArray(t)?Gf(t,e):t&&l_(t)?Gf(t.\u0275providers,e):e(t)}function zt(n,e){let t;n instanceof So?(Eo(n),t=n):t=new cc(n);let i,r=Gn(t),s=Pt(void 0);try{return e()}finally{Gn(r),Pt(s)}}function __(){return u_()!==void 0||mo()!=null}function aI(n){if(!__())throw new O(-203,!1)}function lI(n){return typeof n=="function"}var ii=0,K=1,Y=2,vt=3,gn=4,Ot=5,ls=6,fc=7,tt=8,cs=9,Jn=10,Ke=11,xo=12,gw=13,ys=14,Ht=15,ar=16,is=17,ei=18,Vc=19,E_=20,Ti=21,xf=22,lr=23,sn=24,If=25,yt=26,C_=1;var cr=7,pc=8,us=9,mt=10;function Mi(n){return Array.isArray(n)&&typeof n[C_]=="object"}function ri(n){return Array.isArray(n)&&n[C_]===!0}function A_(n){return(n.flags&4)!==0}function bs(n){return n.componentOffset>-1}function qp(n){return(n.flags&1)===1}function Tn(n){return!!n.template}function gc(n){return(n[Y]&512)!==0}function ws(n){return(n[Y]&256)===256}var qf=class{previousValue;currentValue;firstChange;constructor(e,t,i){this.previousValue=e,this.currentValue=t,this.firstChange=i}isFirstChange(){return this.firstChange}};function D_(n,e,t,i){e!==null?e.applyValueToInputSignal(e,i):n[t]=i}var si=(()=>{let n=()=>S_;return n.ngInherit=!0,n})();function S_(n){return n.type.prototype.ngOnChanges&&(n.setInput=uI),cI}function cI(){let n=I_(this),e=n?.current;if(e){let t=n.previous;if(t===or)n.previous=e;else for(let i in e)t[i]=e[i];n.current=null,this.ngOnChanges(e)}}function uI(n,e,t,i,r){let s=this.declaredInputs[i],o=I_(n)||dI(n,{previous:or,current:null}),a=o.current||(o.current={}),l=o.previous,c=l[s];a[s]=new qf(c&&c.currentValue,t,l===or),D_(n,e,r,t)}var x_="__ngSimpleChanges__";function I_(n){return n[x_]||null}function dI(n,e){return n[x_]=e}var mw=null;var Ie=function(n,e=null,t){mw?.(n,e,t)},hI="svg",fI="math";function Mn(n){for(;Array.isArray(n);)n=n[ii];return n}function T_(n,e){return Mn(e[n])}function On(n,e){return Mn(e[n.index])}function Yp(n,e){return n.data[e]}function pI(n,e){return n[e]}function gI(n,e,t,i){t>=n.data.length&&(n.data[t]=null,n.blueprint[t]=null),e[t]=i}function Rn(n,e){let t=e[n];return Mi(t)?t:t[ii]}function mI(n){return(n[Y]&4)===4}function Xp(n){return(n[Y]&128)===128}function vI(n){return ri(n[vt])}function ds(n,e){return e==null?null:n[e]}function M_(n){n[is]=0}function R_(n){n[Y]&1024||(n[Y]|=1024,Xp(n)&&Vo(n))}function yI(n,e){for(;n>0;)e=e[ys],n--;return e}function jc(n){return!!(n[Y]&9216||n[sn]?.dirty)}function Yf(n){n[Jn].changeDetectionScheduler?.notify(8),n[Y]&64&&(n[Y]|=1024),jc(n)&&Vo(n)}function Vo(n){n[Jn].changeDetectionScheduler?.notify(0);let e=ur(n);for(;e!==null&&!(e[Y]&8192||(e[Y]|=8192,!Xp(e)));)e=ur(e)}function P_(n,e){if(ws(n))throw new O(911,!1);n[Ti]===null&&(n[Ti]=[]),n[Ti].push(e)}function bI(n,e){if(n[Ti]===null)return;let t=n[Ti].indexOf(e);t!==-1&&n[Ti].splice(t,1)}function ur(n){let e=n[vt];return ri(e)?e[vt]:e}function Kp(n){return n[fc]??=[]}function Zp(n){return n.cleanup??=[]}function wI(n,e,t,i){let r=Kp(e);r.push(t),n.firstCreatePass&&Zp(n).push(i,r.length-1)}var ae={lFrame:H_(null),bindingsEnabled:!0,skipHydrationRootTNode:null};var Xf=!1;function _I(){return ae.lFrame.elementDepthCount}function EI(){ae.lFrame.elementDepthCount++}function CI(){ae.lFrame.elementDepthCount--}function N_(){return ae.bindingsEnabled}function k_(){return ae.skipHydrationRootTNode!==null}function AI(n){return ae.skipHydrationRootTNode===n}function DI(){ae.skipHydrationRootTNode=null}function ee(){return ae.lFrame.lView}function ot(){return ae.lFrame.tView}function St(n){return ae.lFrame.contextLView=n,n[tt]}function xt(n){return ae.lFrame.contextLView=null,n}function Wt(){let n=O_();for(;n!==null&&n.type===64;)n=n.parent;return n}function O_(){return ae.lFrame.currentTNode}function SI(){let n=ae.lFrame,e=n.currentTNode;return n.isParent?e:e.parent}function jo(n,e){let t=ae.lFrame;t.currentTNode=n,t.isParent=e}function L_(){return ae.lFrame.isParent}function F_(){ae.lFrame.isParent=!1}function V_(){return Xf}function mc(n){let e=Xf;return Xf=n,e}function _s(){let n=ae.lFrame,e=n.bindingRootIndex;return e===-1&&(e=n.bindingRootIndex=n.tView.bindingStartIndex),e}function xI(n){return ae.lFrame.bindingIndex=n}function Es(){return ae.lFrame.bindingIndex++}function II(n){let e=ae.lFrame,t=e.bindingIndex;return e.bindingIndex=e.bindingIndex+n,t}function TI(){return ae.lFrame.inI18n}function MI(n,e){let t=ae.lFrame;t.bindingIndex=t.bindingRootIndex=n,Kf(e)}function RI(){return ae.lFrame.currentDirectiveIndex}function Kf(n){ae.lFrame.currentDirectiveIndex=n}function PI(n){let e=ae.lFrame.currentDirectiveIndex;return e===-1?null:n[e]}function j_(){return ae.lFrame.currentQueryIndex}function Qp(n){ae.lFrame.currentQueryIndex=n}function NI(n){let e=n[K];return e.type===2?e.declTNode:e.type===1?n[Ot]:null}function B_(n,e,t){if(t&J.SkipSelf){let r=e,s=n;for(;r=r.parent,r===null&&!(t&J.Host);)if(r=NI(s),r===null||(s=s[ys],r.type&10))break;if(r===null)return!1;e=r,n=s}let i=ae.lFrame=U_();return i.currentTNode=e,i.lView=n,!0}function Jp(n){let e=U_(),t=n[K];ae.lFrame=e,e.currentTNode=t.firstChild,e.lView=n,e.tView=t,e.contextLView=n,e.bindingIndex=t.bindingStartIndex,e.inI18n=!1}function U_(){let n=ae.lFrame,e=n===null?null:n.child;return e===null?H_(n):e}function H_(n){let e={currentTNode:null,isParent:!0,lView:null,tView:null,selectedIndex:-1,contextLView:null,elementDepthCount:0,currentNamespace:null,currentDirectiveIndex:-1,bindingRootIndex:-1,bindingIndex:-1,currentQueryIndex:0,parent:n,child:null,inI18n:!1};return n!==null&&(n.child=e),e}function $_(){let n=ae.lFrame;return ae.lFrame=n.parent,n.currentTNode=null,n.lView=null,n}var z_=$_;function eg(){let n=$_();n.isParent=!0,n.tView=null,n.selectedIndex=-1,n.contextLView=null,n.elementDepthCount=0,n.currentDirectiveIndex=-1,n.currentNamespace=null,n.bindingRootIndex=-1,n.bindingIndex=-1,n.currentQueryIndex=0}function kI(n){return(ae.lFrame.contextLView=yI(n,ae.lFrame.contextLView))[tt]}function vr(){return ae.lFrame.selectedIndex}function dr(n){ae.lFrame.selectedIndex=n}function tg(){let n=ae.lFrame;return Yp(n.tView,n.selectedIndex)}function OI(){return ae.lFrame.currentNamespace}var W_=!0;function ng(){return W_}function ig(n){W_=n}function LI(n,e,t){let{ngOnChanges:i,ngOnInit:r,ngDoCheck:s}=e.type.prototype;if(i){let o=S_(e);(t.preOrderHooks??=[]).push(n,o),(t.preOrderCheckHooks??=[]).push(n,o)}r&&(t.preOrderHooks??=[]).push(0-n,r),s&&((t.preOrderHooks??=[]).push(n,s),(t.preOrderCheckHooks??=[]).push(n,s))}function G_(n,e){for(let t=e.directiveStart,i=e.directiveEnd;t=i)break}else e[l]<0&&(n[is]+=65536),(a>14>16&&(n[Y]&3)===e&&(n[Y]+=16384,vw(a,s)):vw(a,s)}var ss=-1,hr=class{factory;injectImpl;resolving=!1;canSeeViewProviders;multi;componentProviders;index;providerFactory;constructor(e,t,i){this.factory=e,this.canSeeViewProviders=t,this.injectImpl=i}};function VI(n){return(n.flags&8)!==0}function jI(n){return(n.flags&16)!==0}function BI(n,e,t){let i=0;for(;ie){o=s-1;break}}}for(;s>16}function yc(n,e){let t=$I(n),i=e;for(;t>0;)i=i[ys],t--;return i}var Zf=!0;function bc(n){let e=Zf;return Zf=n,e}var zI=256,X_=zI-1,K_=5,WI=0,In={};function GI(n,e,t){let i;typeof t=="string"?i=t.charCodeAt(0)||0:t.hasOwnProperty(Ao)&&(i=t[Ao]),i==null&&(i=t[Ao]=WI++);let r=i&X_,s=1<>K_)]|=s}function wc(n,e){let t=Z_(n,e);if(t!==-1)return t;let i=e[K];i.firstCreatePass&&(n.injectorIndex=e.length,Mf(i.data,n),Mf(e,null),Mf(i.blueprint,null));let r=rg(n,e),s=n.injectorIndex;if(Y_(r)){let o=vc(r),a=yc(r,e),l=a[K].data;for(let c=0;c<8;c++)e[s+c]=a[o+c]|l[o+c]}return e[s+8]=r,s}function Mf(n,e){n.push(0,0,0,0,0,0,0,0,e)}function Z_(n,e){return n.injectorIndex===-1||n.parent&&n.parent.injectorIndex===n.injectorIndex||e[n.injectorIndex+8]===null?-1:n.injectorIndex}function rg(n,e){if(n.parent&&n.parent.injectorIndex!==-1)return n.parent.injectorIndex;let t=0,i=null,r=e;for(;r!==null;){if(i=n0(r),i===null)return ss;if(t++,r=r[ys],i.injectorIndex!==-1)return i.injectorIndex|t<<16}return ss}function Qf(n,e,t){GI(n,e,t)}function Q_(n,e,t){if(t&J.Optional||n!==void 0)return n;$p(e,"NodeInjector")}function J_(n,e,t,i){if(t&J.Optional&&i===void 0&&(i=null),!(t&(J.Self|J.Host))){let r=n[cs],s=Pt(void 0);try{return r?r.get(e,i,t&J.Optional):d_(e,i,t&J.Optional)}finally{Pt(s)}}return Q_(i,e,t)}function e0(n,e,t,i=J.Default,r){if(n!==null){if(e[Y]&2048&&!(i&J.Self)){let o=KI(n,e,t,i,In);if(o!==In)return o}let s=t0(n,e,t,i,In);if(s!==In)return s}return J_(e,t,i,r)}function t0(n,e,t,i,r){let s=YI(t);if(typeof s=="function"){if(!B_(e,n,i))return i&J.Host?Q_(r,t,i):J_(e,t,i,r);try{let o;if(o=s(i),o==null&&!(i&J.Optional))$p(t);else return o}finally{z_()}}else if(typeof s=="number"){let o=null,a=Z_(n,e),l=ss,c=i&J.Host?e[Ht][Ot]:null;for((a===-1||i&J.SkipSelf)&&(l=a===-1?rg(n,e):e[a+8],l===ss||!ww(i,!1)?a=-1:(o=e[K],a=vc(l),e=yc(l,e)));a!==-1;){let u=e[K];if(bw(s,a,u.data)){let d=qI(a,e,t,o,i,c);if(d!==In)return d}l=e[a+8],l!==ss&&ww(i,e[K].data[a+8]===c)&&bw(s,a,e)?(o=u,a=vc(l),e=yc(l,e)):a=-1}}return r}function qI(n,e,t,i,r,s){let o=e[K],a=o.data[n+8],l=i==null?bs(a)&&Zf:i!=o&&(a.type&3)!==0,c=r&J.Host&&s===a,u=sc(a,o,t,l,c);return u!==null?To(e,o,u,a,r):In}function sc(n,e,t,i,r){let s=n.providerIndexes,o=e.data,a=s&1048575,l=n.directiveStart,c=n.directiveEnd,u=s>>20,d=i?a:a+u,h=r?a+u:c;for(let f=d;f=l&&p.type===t)return f}if(r){let f=o[l];if(f&&Tn(f)&&f.type===t)return l}return null}function To(n,e,t,i,r){let s=n[t],o=e.data;if(s instanceof hr){let a=s;a.resolving&&c_(Px(o[t]));let l=bc(a.canSeeViewProviders);a.resolving=!0;let c,u=a.injectImpl?Pt(a.injectImpl):null,d=B_(n,i,J.Default);try{s=n[t]=a.factory(void 0,r,o,n,i),e.firstCreatePass&&t>=i.directiveStart&&LI(t,o[t],e)}finally{u!==null&&Pt(u),bc(l),a.resolving=!1,z_()}}return s}function YI(n){if(typeof n=="string")return n.charCodeAt(0)||0;let e=n.hasOwnProperty(Ao)?n[Ao]:void 0;return typeof e=="number"?e>=0?e&X_:XI:e}function bw(n,e,t){let i=1<>K_)]&i)}function ww(n,e){return!(n&J.Self)&&!(n&J.Host&&e)}var rr=class{_tNode;_lView;constructor(e,t){this._tNode=e,this._lView=t}get(e,t,i){return e0(this._tNode,this._lView,e,Lc(i),t)}};function XI(){return new rr(Wt(),ee())}function mn(n){return Oo(()=>{let e=n.prototype.constructor,t=e[lc]||Jf(e),i=Object.prototype,r=Object.getPrototypeOf(n.prototype).constructor;for(;r&&r!==i;){let s=r[lc]||Jf(r);if(s&&s!==t)return s;r=Object.getPrototypeOf(r)}return s=>new s})}function Jf(n){return r_(n)?()=>{let e=Jf(Dt(n));return e&&e()}:sr(n)}function KI(n,e,t,i,r){let s=n,o=e;for(;s!==null&&o!==null&&o[Y]&2048&&!gc(o);){let a=t0(s,o,t,i|J.Self,In);if(a!==In)return a;let l=s.parent;if(!l){let c=o[E_];if(c){let u=c.get(t,In,i);if(u!==In)return u}l=n0(o),o=o[ys]}s=l}return r}function n0(n){let e=n[K],t=e.type;return t===2?e.declTNode:t===1?n[Ot]:null}function _w(n,e=null,t=null,i){let r=i0(n,e,t,i);return r.resolveInjectorInitializers(),r}function i0(n,e=null,t=null,i,r=new Set){let s=[t||rn,Zx(n)];return i=i||(typeof n=="object"?void 0:Nt(n)),new So(s,e||Gp(),i||null,r)}var Pn=class n{static THROW_IF_NOT_FOUND=ir;static NULL=new hc;static create(e,t){if(Array.isArray(e))return _w({name:""},t,e,"");{let i=e.name??"";return _w({name:i},e.parent,e.providers,i)}}static \u0275prov=P({token:n,providedIn:"any",factory:()=>F(p_)});static __NG_ELEMENT_ID__=-1};var ZI=new L("");ZI.__NG_ELEMENT_ID__=n=>{let e=Wt();if(e===null)throw new O(204,!1);if(e.type&2)return e.value;if(n&J.Optional)return null;throw new O(204,!1)};var r0=!1,yr=(()=>{class n{static __NG_ELEMENT_ID__=QI;static __NG_ENV_ID__=t=>t}return n})(),_c=class extends yr{_lView;constructor(e){super(),this._lView=e}onDestroy(e){let t=this._lView;return ws(t)?(e(),()=>{}):(P_(t,e),()=>bI(t,e))}};function QI(){return new _c(ee())}var hs=class{},sg=new L("",{providedIn:"root",factory:()=>!1});var s0=new L(""),o0=new L(""),Ri=(()=>{class n{taskId=0;pendingTasks=new Set;get _hasPendingTasks(){return this.hasPendingTasks.value}hasPendingTasks=new et(!1);add(){this._hasPendingTasks||this.hasPendingTasks.next(!0);let t=this.taskId++;return this.pendingTasks.add(t),t}has(t){return this.pendingTasks.has(t)}remove(t){this.pendingTasks.delete(t),this.pendingTasks.size===0&&this._hasPendingTasks&&this.hasPendingTasks.next(!1)}ngOnDestroy(){this.pendingTasks.clear(),this._hasPendingTasks&&this.hasPendingTasks.next(!1)}static \u0275prov=P({token:n,providedIn:"root",factory:()=>new n})}return n})();var ep=class extends Se{__isAsync;destroyRef=void 0;pendingTasks=void 0;constructor(e=!1){super(),this.__isAsync=e,__()&&(this.destroyRef=T(yr,{optional:!0})??void 0,this.pendingTasks=T(Ri,{optional:!0})??void 0)}emit(e){let t=Z(null);try{super.next(e)}finally{Z(t)}}subscribe(e,t,i){let r=e,s=t||(()=>null),o=i;if(e&&typeof e=="object"){let l=e;r=l.next?.bind(l),s=l.error?.bind(l),o=l.complete?.bind(l)}this.__isAsync&&(s=this.wrapInTimeout(s),r&&(r=this.wrapInTimeout(r)),o&&(o=this.wrapInTimeout(o)));let a=super.subscribe({next:r,error:s,complete:o});return e instanceof je&&e.add(a),a}wrapInTimeout(e){return t=>{let i=this.pendingTasks?.add();setTimeout(()=>{try{e(t)}finally{i!==void 0&&this.pendingTasks?.remove(i)}})}}},oe=ep;function Mo(...n){}function a0(n){let e,t;function i(){n=Mo;try{t!==void 0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t),e!==void 0&&clearTimeout(e)}catch{}}return e=setTimeout(()=>{n(),i()}),typeof requestAnimationFrame=="function"&&(t=requestAnimationFrame(()=>{n(),i()})),()=>i()}function Ew(n){return queueMicrotask(()=>n()),()=>{n=Mo}}var og="isAngularZone",Ec=og+"_ID",JI=0,$e=class n{hasPendingMacrotasks=!1;hasPendingMicrotasks=!1;isStable=!0;onUnstable=new oe(!1);onMicrotaskEmpty=new oe(!1);onStable=new oe(!1);onError=new oe(!1);constructor(e){let{enableLongStackTrace:t=!1,shouldCoalesceEventChangeDetection:i=!1,shouldCoalesceRunChangeDetection:r=!1,scheduleInRootZone:s=r0}=e;if(typeof Zone>"u")throw new O(908,!1);Zone.assertZonePatched();let o=this;o._nesting=0,o._outer=o._inner=Zone.current,Zone.TaskTrackingZoneSpec&&(o._inner=o._inner.fork(new Zone.TaskTrackingZoneSpec)),t&&Zone.longStackTraceZoneSpec&&(o._inner=o._inner.fork(Zone.longStackTraceZoneSpec)),o.shouldCoalesceEventChangeDetection=!r&&i,o.shouldCoalesceRunChangeDetection=r,o.callbackScheduled=!1,o.scheduleInRootZone=s,nT(o)}static isInAngularZone(){return typeof Zone<"u"&&Zone.current.get(og)===!0}static assertInAngularZone(){if(!n.isInAngularZone())throw new O(909,!1)}static assertNotInAngularZone(){if(n.isInAngularZone())throw new O(909,!1)}run(e,t,i){return this._inner.run(e,t,i)}runTask(e,t,i,r){let s=this._inner,o=s.scheduleEventTask("NgZoneEvent: "+r,e,eT,Mo,Mo);try{return s.runTask(o,t,i)}finally{s.cancelTask(o)}}runGuarded(e,t,i){return this._inner.runGuarded(e,t,i)}runOutsideAngular(e){return this._outer.run(e)}},eT={};function ag(n){if(n._nesting==0&&!n.hasPendingMicrotasks&&!n.isStable)try{n._nesting++,n.onMicrotaskEmpty.emit(null)}finally{if(n._nesting--,!n.hasPendingMicrotasks)try{n.runOutsideAngular(()=>n.onStable.emit(null))}finally{n.isStable=!0}}}function tT(n){if(n.isCheckStableRunning||n.callbackScheduled)return;n.callbackScheduled=!0;function e(){a0(()=>{n.callbackScheduled=!1,tp(n),n.isCheckStableRunning=!0,ag(n),n.isCheckStableRunning=!1})}n.scheduleInRootZone?Zone.root.run(()=>{e()}):n._outer.run(()=>{e()}),tp(n)}function nT(n){let e=()=>{tT(n)},t=JI++;n._inner=n._inner.fork({name:"angular",properties:{[og]:!0,[Ec]:t,[Ec+t]:!0},onInvokeTask:(i,r,s,o,a,l)=>{if(iT(l))return i.invokeTask(s,o,a,l);try{return Cw(n),i.invokeTask(s,o,a,l)}finally{(n.shouldCoalesceEventChangeDetection&&o.type==="eventTask"||n.shouldCoalesceRunChangeDetection)&&e(),Aw(n)}},onInvoke:(i,r,s,o,a,l,c)=>{try{return Cw(n),i.invoke(s,o,a,l,c)}finally{n.shouldCoalesceRunChangeDetection&&!n.callbackScheduled&&!rT(l)&&e(),Aw(n)}},onHasTask:(i,r,s,o)=>{i.hasTask(s,o),r===s&&(o.change=="microTask"?(n._hasPendingMicrotasks=o.microTask,tp(n),ag(n)):o.change=="macroTask"&&(n.hasPendingMacrotasks=o.macroTask))},onHandleError:(i,r,s,o)=>(i.handleError(s,o),n.runOutsideAngular(()=>n.onError.emit(o)),!1)})}function tp(n){n._hasPendingMicrotasks||(n.shouldCoalesceEventChangeDetection||n.shouldCoalesceRunChangeDetection)&&n.callbackScheduled===!0?n.hasPendingMicrotasks=!0:n.hasPendingMicrotasks=!1}function Cw(n){n._nesting++,n.isStable&&(n.isStable=!1,n.onUnstable.emit(null))}function Aw(n){n._nesting--,ag(n)}var np=class{hasPendingMicrotasks=!1;hasPendingMacrotasks=!1;isStable=!0;onUnstable=new oe;onMicrotaskEmpty=new oe;onStable=new oe;onError=new oe;run(e,t,i){return e.apply(t,i)}runGuarded(e,t,i){return e.apply(t,i)}runOutsideAngular(e){return e()}runTask(e,t,i,r){return e.apply(t,i)}};function iT(n){return l0(n,"__ignore_ng_zone__")}function rT(n){return l0(n,"__scheduler_tick__")}function l0(n,e){return!Array.isArray(n)||n.length!==1?!1:n[0]?.data?.[e]===!0}var Nn=class{_console=console;handleError(e){this._console.error("ERROR",e)}},sT=new L("",{providedIn:"root",factory:()=>{let n=T($e),e=T(Nn);return t=>n.runOutsideAngular(()=>e.handleError(t))}}),ip=class{destroyed=!1;listeners=null;errorHandler=T(Nn,{optional:!0});destroyRef=T(yr);constructor(){this.destroyRef.onDestroy(()=>{this.destroyed=!0,this.listeners=null})}subscribe(e){if(this.destroyed)throw new O(953,!1);return(this.listeners??=[]).push(e),{unsubscribe:()=>{let t=this.listeners?.indexOf(e);t!==void 0&&t!==-1&&this.listeners?.splice(t,1)}}}emit(e){if(this.destroyed){console.warn(e_(953,!1));return}if(this.listeners===null)return;let t=Z(null);try{for(let i of this.listeners)try{i(e)}catch(r){this.errorHandler?.handleError(r)}}finally{Z(t)}}};function c0(n){return new ip}function Dw(n,e){return n_(n,e)}function oT(n){return n_(t_,n)}var Cs=(Dw.required=oT,Dw);function aT(){return As(Wt(),ee())}function As(n,e){return new Lt(On(n,e))}var Lt=(()=>{class n{nativeElement;constructor(t){this.nativeElement=t}static __NG_ELEMENT_ID__=aT}return n})();function lT(n){return n instanceof Lt?n.nativeElement:n}function cT(n){return typeof n=="function"&&n[nn]!==void 0}function ze(n,e){let t=af(n,e?.equal),i=t[nn];return t.set=r=>go(i,r),t.update=r=>lf(i,r),t.asReadonly=uT.bind(t),t}function uT(){let n=this[nn];if(n.readonlyFn===void 0){let e=()=>this();e[nn]=n,n.readonlyFn=e}return n.readonlyFn}function u0(n){return cT(n)&&typeof n.set=="function"}function dT(){return this._results[Symbol.iterator]()}var rp=class{_emitDistinctChangesOnly;dirty=!0;_onDirty=void 0;_results=[];_changesDetected=!1;_changes=void 0;length=0;first=void 0;last=void 0;get changes(){return this._changes??=new Se}constructor(e=!1){this._emitDistinctChangesOnly=e}get(e){return this._results[e]}map(e){return this._results.map(e)}filter(e){return this._results.filter(e)}find(e){return this._results.find(e)}reduce(e,t){return this._results.reduce(e,t)}forEach(e){this._results.forEach(e)}some(e){return this._results.some(e)}toArray(){return this._results.slice()}toString(){return this._results.toString()}reset(e,t){this.dirty=!1;let i=zx(e);(this._changesDetected=!$x(this._results,i,t))&&(this._results=i,this.length=i.length,this.last=i[this.length-1],this.first=i[0])}notifyOnChanges(){this._changes!==void 0&&(this._changesDetected||!this._emitDistinctChangesOnly)&&this._changes.next(this)}onDirty(e){this._onDirty=e}setDirty(){this.dirty=!0,this._onDirty?.()}destroy(){this._changes!==void 0&&(this._changes.complete(),this._changes.unsubscribe())}[Symbol.iterator]=dT};function d0(n){return(n.flags&128)===128}var h0=function(n){return n[n.OnPush=0]="OnPush",n[n.Default=1]="Default",n}(h0||{}),f0=new Map,hT=0;function fT(){return hT++}function pT(n){f0.set(n[Vc],n)}function sp(n){f0.delete(n[Vc])}var Sw="__ngContext__";function Bo(n,e){Mi(e)?(n[Sw]=e[Vc],pT(e)):n[Sw]=e}function p0(n){return m0(n[xo])}function g0(n){return m0(n[gn])}function m0(n){for(;n!==null&&!ri(n);)n=n[gn];return n}var op;function v0(n){op=n}function y0(){if(op!==void 0)return op;if(typeof document<"u")return document;throw new O(210,!1)}var lg=new L("",{providedIn:"root",factory:()=>gT}),gT="ng",cg=new L(""),Uo=new L("",{providedIn:"platform",factory:()=>"unknown"});var ug=new L("",{providedIn:"root",factory:()=>y0().body?.querySelector("[ngCspNonce]")?.getAttribute("ngCspNonce")||null});var mT="h",vT="b";var b0=!1,yT=new L("",{providedIn:"root",factory:()=>b0});var w0=function(n){return n[n.CHANGE_DETECTION=0]="CHANGE_DETECTION",n[n.AFTER_NEXT_RENDER=1]="AFTER_NEXT_RENDER",n}(w0||{}),Bc=new L(""),xw=new Set;function Ho(n){xw.has(n)||(xw.add(n),performance?.mark?.("mark_feature_usage",{detail:{feature:n}}))}var _0=(()=>{class n{view;node;constructor(t,i){this.view=t,this.node=i}static __NG_ELEMENT_ID__=bT}return n})();function bT(){return new _0(ee(),Wt())}var wT=(()=>{class n{impl=null;execute(){this.impl?.execute()}static \u0275prov=P({token:n,providedIn:"root",factory:()=>new n})}return n})();var _T=(n,e,t,i)=>{};function ET(n,e,t,i){_T(n,e,t,i)}var CT=()=>null;function E0(n,e,t=!1){return CT(n,e,t)}function C0(n,e){let t=n.contentQueries;if(t!==null){let i=Z(null);try{for(let r=0;rn,createScript:n=>n,createScriptURL:n=>n})}catch{}return Ql}function Uc(n){return AT()?.createHTML(n)||n}var Jl;function DT(){if(Jl===void 0&&(Jl=null,Qn.trustedTypes))try{Jl=Qn.trustedTypes.createPolicy("angular#unsafe-bypass",{createHTML:n=>n,createScript:n=>n,createScriptURL:n=>n})}catch{}return Jl}function Iw(n){return DT()?.createHTML(n)||n}var Cc=class{changingThisBreaksApplicationSecurity;constructor(e){this.changingThisBreaksApplicationSecurity=e}toString(){return`SafeValue must use [property]=binding: ${this.changingThisBreaksApplicationSecurity} (see ${Jw})`}};function dg(n){return n instanceof Cc?n.changingThisBreaksApplicationSecurity:n}function D0(n,e){let t=ST(n);if(t!=null&&t!==e){if(t==="ResourceURL"&&e==="URL")return!0;throw new Error(`Required a safe ${e}, got a ${t} (see ${Jw})`)}return t===e}function ST(n){return n instanceof Cc&&n.getTypeName()||null}function xT(n){let e=new cp(n);return IT()?new lp(e):e}var lp=class{inertDocumentHelper;constructor(e){this.inertDocumentHelper=e}getInertBodyElement(e){e=""+e;try{let t=new window.DOMParser().parseFromString(Uc(e),"text/html").body;return t===null?this.inertDocumentHelper.getInertBodyElement(e):(t.firstChild?.remove(),t)}catch{return null}}},cp=class{defaultDoc;inertDocument;constructor(e){this.defaultDoc=e,this.inertDocument=this.defaultDoc.implementation.createHTMLDocument("sanitization-inert")}getInertBodyElement(e){let t=this.inertDocument.createElement("template");return t.innerHTML=Uc(e),t}};function IT(){try{return!!new window.DOMParser().parseFromString(Uc(""),"text/html")}catch{return!1}}var TT=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:\/?#]*(?:[\/?#]|$))/i;function S0(n){return n=String(n),n.match(TT)?n:"unsafe:"+n}function oi(n){let e={};for(let t of n.split(","))e[t]=!0;return e}function $o(...n){let e={};for(let t of n)for(let i in t)t.hasOwnProperty(i)&&(e[i]=!0);return e}var x0=oi("area,br,col,hr,img,wbr"),I0=oi("colgroup,dd,dt,li,p,tbody,td,tfoot,th,thead,tr"),T0=oi("rp,rt"),MT=$o(T0,I0),RT=$o(I0,oi("address,article,aside,blockquote,caption,center,del,details,dialog,dir,div,dl,figure,figcaption,footer,h1,h2,h3,h4,h5,h6,header,hgroup,hr,ins,main,map,menu,nav,ol,pre,section,summary,table,ul")),PT=$o(T0,oi("a,abbr,acronym,audio,b,bdi,bdo,big,br,cite,code,del,dfn,em,font,i,img,ins,kbd,label,map,mark,picture,q,ruby,rp,rt,s,samp,small,source,span,strike,strong,sub,sup,time,track,tt,u,var,video")),Tw=$o(x0,RT,PT,MT),M0=oi("background,cite,href,itemtype,longdesc,poster,src,xlink:href"),NT=oi("abbr,accesskey,align,alt,autoplay,axis,bgcolor,border,cellpadding,cellspacing,class,clear,color,cols,colspan,compact,controls,coords,datetime,default,dir,download,face,headers,height,hidden,hreflang,hspace,ismap,itemscope,itemprop,kind,label,lang,language,loop,media,muted,nohref,nowrap,open,preload,rel,rev,role,rows,rowspan,rules,scope,scrolling,shape,size,sizes,span,srclang,srcset,start,summary,tabindex,target,title,translate,type,usemap,valign,value,vspace,width"),kT=oi("aria-activedescendant,aria-atomic,aria-autocomplete,aria-busy,aria-checked,aria-colcount,aria-colindex,aria-colspan,aria-controls,aria-current,aria-describedby,aria-details,aria-disabled,aria-dropeffect,aria-errormessage,aria-expanded,aria-flowto,aria-grabbed,aria-haspopup,aria-hidden,aria-invalid,aria-keyshortcuts,aria-label,aria-labelledby,aria-level,aria-live,aria-modal,aria-multiline,aria-multiselectable,aria-orientation,aria-owns,aria-placeholder,aria-posinset,aria-pressed,aria-readonly,aria-relevant,aria-required,aria-roledescription,aria-rowcount,aria-rowindex,aria-rowspan,aria-selected,aria-setsize,aria-sort,aria-valuemax,aria-valuemin,aria-valuenow,aria-valuetext"),OT=$o(M0,NT,kT),LT=oi("script,style,template"),up=class{sanitizedSomething=!1;buf=[];sanitizeChildren(e){let t=e.firstChild,i=!0,r=[];for(;t;){if(t.nodeType===Node.ELEMENT_NODE?i=this.startElement(t):t.nodeType===Node.TEXT_NODE?this.chars(t.nodeValue):this.sanitizedSomething=!0,i&&t.firstChild){r.push(t),t=jT(t);continue}for(;t;){t.nodeType===Node.ELEMENT_NODE&&this.endElement(t);let s=VT(t);if(s){t=s;break}t=r.pop()}}return this.buf.join("")}startElement(e){let t=Mw(e).toLowerCase();if(!Tw.hasOwnProperty(t))return this.sanitizedSomething=!0,!LT.hasOwnProperty(t);this.buf.push("<"),this.buf.push(t);let i=e.attributes;for(let r=0;r"),!0}endElement(e){let t=Mw(e).toLowerCase();Tw.hasOwnProperty(t)&&!x0.hasOwnProperty(t)&&(this.buf.push(""))}chars(e){this.buf.push(Rw(e))}};function FT(n,e){return(n.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY)!==Node.DOCUMENT_POSITION_CONTAINED_BY}function VT(n){let e=n.nextSibling;if(e&&n!==e.previousSibling)throw R0(e);return e}function jT(n){let e=n.firstChild;if(e&&FT(n,e))throw R0(e);return e}function Mw(n){let e=n.nodeName;return typeof e=="string"?e:"FORM"}function R0(n){return new Error(`Failed to sanitize html because the element is clobbered: ${n.outerHTML}`)}var BT=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,UT=/([^\#-~ |!])/g;function Rw(n){return n.replace(/&/g,"&").replace(BT,function(e){let t=e.charCodeAt(0),i=e.charCodeAt(1);return"&#"+((t-55296)*1024+(i-56320)+65536)+";"}).replace(UT,function(e){return"&#"+e.charCodeAt(0)+";"}).replace(//g,">")}var ec;function HT(n,e){let t=null;try{ec=ec||xT(n);let i=e?String(e):"";t=ec.getInertBodyElement(i);let r=5,s=i;do{if(r===0)throw new Error("Failed to sanitize html because the input is unstable");r--,i=s,s=t.innerHTML,t=ec.getInertBodyElement(i)}while(i!==s);let a=new up().sanitizeChildren(Pw(t)||t);return Uc(a)}finally{if(t){let i=Pw(t)||t;for(;i.firstChild;)i.firstChild.remove()}}}function Pw(n){return"content"in n&&$T(n)?n.content:null}function $T(n){return n.nodeType===Node.ELEMENT_NODE&&n.nodeName==="TEMPLATE"}function zT(n,e){return n.createText(e)}function WT(n,e,t){n.setValue(e,t)}function P0(n,e,t){return n.createElement(e,t)}function Ac(n,e,t,i,r){n.insertBefore(e,t,i,r)}function N0(n,e,t){n.appendChild(e,t)}function Nw(n,e,t,i,r){i!==null?Ac(n,e,t,i,r):N0(n,e,t)}function GT(n,e,t){n.removeChild(null,e,t)}function qT(n,e,t){n.setAttribute(e,"style",t)}function YT(n,e,t){t===""?n.removeAttribute(e,"class"):n.setAttribute(e,"class",t)}function k0(n,e,t){let{mergedAttrs:i,classes:r,styles:s}=t;i!==null&&BI(n,e,i),r!==null&&YT(n,e,r),s!==null&&qT(n,e,s)}var hg=function(n){return n[n.NONE=0]="NONE",n[n.HTML=1]="HTML",n[n.STYLE=2]="STYLE",n[n.SCRIPT=3]="SCRIPT",n[n.URL=4]="URL",n[n.RESOURCE_URL=5]="RESOURCE_URL",n}(hg||{});function O0(n){let e=L0();return e?Iw(e.sanitize(hg.HTML,n)||""):D0(n,"HTML")?Iw(dg(n)):HT(y0(),Lo(n))}function fg(n){let e=L0();return e?e.sanitize(hg.URL,n)||"":D0(n,"URL")?dg(n):S0(Lo(n))}function L0(){let n=ee();return n&&n[Jn].sanitizer}function F0(n){return n instanceof Function?n():n}function XT(n,e,t){let i=n.length;for(;;){let r=n.indexOf(e,t);if(r===-1)return r;if(r===0||n.charCodeAt(r-1)<=32){let s=e.length;if(r+s===i||n.charCodeAt(r+s)<=32)return r}t=r+1}}var V0="ng-template";function KT(n,e,t,i){let r=0;if(i){for(;r-1){let s;for(;++rs?d="":d=r[u+1].toLowerCase(),i&2&&c!==d){if(pn(i))return!1;o=!0}}}}return pn(i)||o}function pn(n){return(n&1)===0}function JT(n,e,t,i){if(e===null)return-1;let r=0;if(i||!t){let s=!1;for(;r-1)for(t++;t0?'="'+a+'"':"")+"]"}else i&8?r+="."+o:i&4&&(r+=" "+o);else r!==""&&!pn(o)&&(e+=kw(s,r),r=""),i=o,s=s||!pn(i);t++}return r!==""&&(e+=kw(s,r)),e}function sM(n){return n.map(rM).join(",")}function oM(n){let e=[],t=[],i=1,r=2;for(;iyt&&H0(n,e,yt,!1),Ie(o?2:0,r),t(i,r)}finally{dr(s),Ie(o?3:1,r)}}function yg(n,e,t){gM(n,e,t),(t.flags&64)===64&&mM(n,e,t)}function z0(n,e,t=On){let i=e.localNames;if(i!==null){let r=e.index+1;for(let s=0;snull;function fM(n){return n==="class"?"className":n==="for"?"htmlFor":n==="formaction"?"formAction":n==="innerHtml"?"innerHTML":n==="readonly"?"readOnly":n==="tabindex"?"tabIndex":n}function W0(n,e,t,i,r,s,o,a){if(!a&&bg(e,n,t,i,r)){bs(e)&&pM(t,e.index);return}if(e.type&3){let l=On(e,t);i=fM(i),r=o!=null?o(r,e.value||"",i):r,s.setProperty(l,i,r)}else e.type&12}function pM(n,e){let t=Rn(e,n);t[Y]&16||(t[Y]|=64)}function gM(n,e,t){let i=t.directiveStart,r=t.directiveEnd;bs(t)&&cM(e,t,n.data[i+t.componentOffset]),n.firstCreatePass||wc(t,e);let s=t.initialInputs;for(let o=i;o=0?i[a]():i[-a].unsubscribe(),o+=2}else{let a=i[t[o+1]];t[o].call(a)}i!==null&&(e[fc]=null);let r=e[Ti];if(r!==null){e[Ti]=null;for(let o=0;o{Vo(n.lView)},consumerOnSignalRead(){this.lView[sn]=this}});function HM(n){let e=n[sn]??Object.create($M);return e.lView=n,e}var $M=G(x({},Wr),{consumerIsAlwaysLive:!0,kind:"template",consumerMarkedDirty:n=>{let e=ur(n.lView);for(;e&&!eE(e[K]);)e=ur(e);e&&R_(e)},consumerOnSignalRead(){this.lView[sn]=this}});function eE(n){return n.type!==2}function tE(n){if(n[lr]===null)return;let e=!0;for(;e;){let t=!1;for(let i of n[lr])i.dirty&&(t=!0,i.zone===null||Zone.current===i.zone?i.run():i.zone.run(()=>i.run()));e=t&&!!(n[Y]&8192)}}var zM=100;function nE(n,e=!0,t=0){let r=n[Jn].rendererFactory,s=!1;s||r.begin?.();try{WM(n,t)}catch(o){throw e&&_M(n,o),o}finally{s||r.end?.()}}function WM(n,e){let t=V_();try{mc(!0),fp(n,e);let i=0;for(;jc(n);){if(i===zM)throw new O(103,!1);i++,fp(n,1)}}finally{mc(t)}}function GM(n,e,t,i){if(ws(e))return;let r=e[Y],s=!1,o=!1;Jp(e);let a=!0,l=null,c=null;s||(eE(n)?(c=VM(e),l=fo(c)):ef()===null?(a=!1,c=HM(e),l=fo(c)):e[sn]&&(po(e[sn]),e[sn]=null));try{M_(e),xI(n.bindingStartIndex),t!==null&&$0(n,e,t,2,i);let u=(r&3)===3;if(!s)if(u){let f=n.preOrderCheckHooks;f!==null&&ic(e,f,null)}else{let f=n.preOrderHooks;f!==null&&rc(e,f,0,null),Tf(e,0)}if(o||qM(e),tE(e),iE(e,0),n.contentQueries!==null&&C0(n,e),!s)if(u){let f=n.contentCheckHooks;f!==null&&ic(e,f)}else{let f=n.contentHooks;f!==null&&rc(e,f,1),Tf(e,1)}XM(n,e);let d=n.components;d!==null&&sE(e,d,0);let h=n.viewQuery;if(h!==null&&ap(2,h,i),!s)if(u){let f=n.viewCheckHooks;f!==null&&ic(e,f)}else{let f=n.viewHooks;f!==null&&rc(e,f,2),Tf(e,2)}if(n.firstUpdatePass===!0&&(n.firstUpdatePass=!1),e[xf]){for(let f of e[xf])f();e[xf]=null}s||(Q0(e),e[Y]&=-73)}catch(u){throw s||Vo(e),u}finally{c!==null&&(bl(c,l),a&&BM(c)),eg()}}function iE(n,e){for(let t=p0(n);t!==null;t=g0(t))for(let i=mt;i0&&(n[t-1][gn]=i[gn]);let s=dc(n,mt+e);SM(i[K],i);let o=s[ei];o!==null&&o.detachView(s[K]),i[vt]=null,i[gn]=null,i[Y]&=-129}return i}function KM(n,e,t,i){let r=mt+i,s=t.length;i>0&&(t[r-1][gn]=e),i-1&&(Ro(e,i),dc(t,i))}this._attachedToViewContainer=!1}$c(this._lView[K],this._lView)}onDestroy(e){P_(this._lView,e)}markForCheck(){Sg(this._cdRefInjectingView||this._lView,4)}detach(){this._lView[Y]&=-129}reattach(){Yf(this._lView),this._lView[Y]|=128}detectChanges(){this._lView[Y]|=1024,nE(this._lView,this.notifyErrorHandler)}checkNoChanges(){}attachToViewContainerRef(){if(this._appRef)throw new O(902,!1);this._attachedToViewContainer=!0}detachFromAppRef(){this._appRef=null;let e=gc(this._lView),t=this._lView[ar];t!==null&&!e&&Cg(t,this._lView),q0(this._lView[K],this._lView)}attachToAppRef(e){if(this._attachedToViewContainer)throw new O(902,!1);this._appRef=e;let t=gc(this._lView),i=this._lView[ar];i!==null&&!t&&cE(i,this._lView),Yf(this._lView)}};var fr=(()=>{class n{static __NG_ELEMENT_ID__=JM}return n})(),ZM=fr,QM=class extends ZM{_declarationLView;_declarationTContainer;elementRef;constructor(e,t,i){super(),this._declarationLView=e,this._declarationTContainer=t,this.elementRef=i}get ssrId(){return this._declarationTContainer.tView?.ssrId||null}createEmbeddedView(e,t){return this.createEmbeddedViewImpl(e,t)}createEmbeddedViewImpl(e,t,i){let r=zo(this._declarationLView,this._declarationTContainer,e,{embeddedViewInjector:t,dehydratedView:i});return new Po(r)}};function JM(){return xg(Wt(),ee())}function xg(n,e){return n.type&4?new QM(e,n,As(n,e)):null}function Wc(n,e,t,i,r){let s=n.data[e];if(s===null)s=eR(n,e,t,i,r),TI()&&(s.flags|=32);else if(s.type&64){s.type=t,s.value=i,s.attrs=r;let o=SI();s.injectorIndex=o===null?-1:o.injectorIndex}return jo(s,!0),s}function eR(n,e,t,i,r){let s=O_(),o=L_(),a=o?s:s&&s.parent,l=n.data[e]=nR(n,a,t,e,i,r);return tR(n,l,s,o),l}function tR(n,e,t,i){n.firstChild===null&&(n.firstChild=e),t!==null&&(i?t.child==null&&e.parent!==null&&(t.child=e):t.next===null&&(t.next=e,e.prev=t))}function nR(n,e,t,i,r,s){let o=e?e.injectorIndex:-1,a=0;return k_()&&(a|=128),{type:t,index:i,insertBeforeIndex:null,injectorIndex:o,directiveStart:-1,directiveEnd:-1,directiveStylingLast:-1,componentOffset:-1,propertyBindings:null,flags:a,providerIndexes:0,value:r,attrs:s,mergedAttrs:null,localNames:null,initialInputs:null,inputs:null,hostDirectiveInputs:null,outputs:null,hostDirectiveOutputs:null,directiveToIndex:null,tView:null,next:null,prev:null,projectionNext:null,child:null,parent:e,projection:null,styles:null,stylesWithoutHost:null,residualStyles:void 0,classes:null,classesWithoutHost:null,residualClasses:void 0,classBindings:0,styleBindings:0}}var t3=new RegExp(`^(\\d+)*(${vT}|${mT})*(.*)`);var iR=()=>null;function ps(n,e){return iR(n,e)}var rR=class{},uE=class{},pp=class{resolveComponentFactory(e){throw Error(`No component factory found for ${Nt(e)}.`)}},Gc=class{static NULL=new pp},gs=class{},br=(()=>{class n{destroyNode=null;static __NG_ELEMENT_ID__=()=>sR()}return n})();function sR(){let n=ee(),e=Wt(),t=Rn(e.index,n);return(Mi(t)?t:n)[Ke]}var oR=(()=>{class n{static \u0275prov=P({token:n,providedIn:"root",factory:()=>null})}return n})();var Pf={},gp=class{injector;parentInjector;constructor(e,t){this.injector=e,this.parentInjector=t}get(e,t,i){i=Lc(i);let r=this.injector.get(e,Pf,i);return r!==Pf||t===Pf?r:this.parentInjector.get(e,t,i)}};function Lw(n,e,t){let i=t?n.styles:null,r=t?n.classes:null,s=0;if(e!==null)for(let o=0;o0&&(t.directiveToIndex=new Map);for(let h=0;h0;){let t=n[--e];if(typeof t=="number"&&t<0)return t}return 0}function mR(n,e,t){if(t){if(e.exportAs)for(let i=0;i{let[t,i,r]=n[e],s={propName:t,templateName:e,isSignal:(i&Hc.SignalBased)!==0};return r&&(s.transform=r),s})}function bR(n){return Object.keys(n).map(e=>({propName:n[e],templateName:e}))}function wR(n,e,t){let i=e instanceof kt?e:e?.injector;return i&&n.getStandaloneInjector!==null&&(i=n.getStandaloneInjector(i)||i),i?new gp(t,i):t}function _R(n){let e=n.get(gs,null);if(e===null)throw new O(407,!1);let t=n.get(oR,null),i=n.get(hs,null);return{rendererFactory:e,sanitizer:t,changeDetectionScheduler:i}}function ER(n,e){let t=(n.selectors[0][0]||"div").toLowerCase();return P0(e,t,t==="svg"?hI:t==="math"?fI:null)}var No=class extends uE{componentDef;ngModule;selector;componentType;ngContentSelectors;isBoundToModule;cachedInputs=null;cachedOutputs=null;get inputs(){return this.cachedInputs??=yR(this.componentDef.inputs),this.cachedInputs}get outputs(){return this.cachedOutputs??=bR(this.componentDef.outputs),this.cachedOutputs}constructor(e,t){super(),this.componentDef=e,this.ngModule=t,this.componentType=e.type,this.selector=sM(e.selectors),this.ngContentSelectors=e.ngContentSelectors??[],this.isBoundToModule=!!t}create(e,t,i,r){Ie(22);let s=Z(null);try{let o=this.componentDef,a=i?["ng-version","19.2.18"]:oM(this.componentDef.selectors[0]),l=gg(0,null,null,1,0,null,null,null,null,[a],null),c=wR(o,r||this.ngModule,e),u=_R(c),d=u.rendererFactory.createRenderer(null,o),h=i?uM(d,i,o.encapsulation,c):ER(o,d),f=mg(null,l,null,512|B0(o),null,null,u,d,c,null,E0(h,c,!0));f[yt]=h,Jp(f);let p=null;try{let g=fE(yt,l,f,"#host",()=>[this.componentDef],!0,0);h&&(k0(d,h,g),Bo(h,f)),yg(l,f,g),A0(l,g,f),pE(l,g),t!==void 0&&CR(g,this.ngContentSelectors,t),p=Rn(g.index,f),f[tt]=p[tt],wg(l,f,null)}catch(g){throw p!==null&&sp(p),sp(f),g}finally{Ie(23),eg()}return new mp(this.componentType,f)}finally{Z(s)}}},mp=class extends rR{_rootLView;instance;hostView;changeDetectorRef;componentType;location;previousInputValues=null;_tNode;constructor(e,t){super(),this._rootLView=t,this._tNode=Yp(t[K],yt),this.location=As(this._tNode,t),this.instance=Rn(this._tNode.index,t)[tt],this.hostView=this.changeDetectorRef=new Po(t,void 0,!1),this.componentType=e}setInput(e,t){let i=this._tNode;if(this.previousInputValues??=new Map,this.previousInputValues.has(e)&&Object.is(this.previousInputValues.get(e),t))return;let r=this._rootLView,s=bg(i,r[K],r,e,t);this.previousInputValues.set(e,t);let o=Rn(i.index,r);Sg(o,1)}get injector(){return new rr(this._tNode,this._rootLView)}destroy(){this.hostView.destroy()}onDestroy(e){this.hostView.onDestroy(e)}};function CR(n,e,t){let i=n.projection=[];for(let r=0;r{class n{static __NG_ELEMENT_ID__=AR}return n})();function AR(){let n=Wt();return mE(n,ee())}var DR=Ni,gE=class extends DR{_lContainer;_hostTNode;_hostLView;constructor(e,t,i){super(),this._lContainer=e,this._hostTNode=t,this._hostLView=i}get element(){return As(this._hostTNode,this._hostLView)}get injector(){return new rr(this._hostTNode,this._hostLView)}get parentInjector(){let e=rg(this._hostTNode,this._hostLView);if(Y_(e)){let t=yc(e,this._hostLView),i=vc(e),r=t[K].data[i+8];return new rr(r,t)}else return new rr(null,this._hostLView)}clear(){for(;this.length>0;)this.remove(this.length-1)}get(e){let t=Bw(this._lContainer);return t!==null&&t[e]||null}get length(){return this._lContainer.length-mt}createEmbeddedView(e,t,i){let r,s;typeof i=="number"?r=i:i!=null&&(r=i.index,s=i.injector);let o=ps(this._lContainer,e.ssrId),a=e.createEmbeddedViewImpl(t||{},s,o);return this.insertImpl(a,r,fs(this._hostTNode,o)),a}createComponent(e,t,i,r,s){let o=e&&!lI(e),a;if(o)a=t;else{let p=t||{};a=p.index,i=p.injector,r=p.projectableNodes,s=p.environmentInjector||p.ngModuleRef}let l=o?e:new No(os(e)),c=i||this.parentInjector;if(!s&&l.ngModule==null){let g=(o?c:this.parentInjector).get(kt,null);g&&(s=g)}let u=os(l.componentType??{}),d=ps(this._lContainer,u?.id??null),h=d?.firstChild??null,f=l.create(c,r,h,s);return this.insertImpl(f.hostView,a,fs(this._hostTNode,d)),f}insert(e,t){return this.insertImpl(e,t,!0)}insertImpl(e,t,i){let r=e._lView;if(vI(r)){let a=this.indexOf(e);if(a!==-1)this.detach(a);else{let l=r[vt],c=new gE(l,l[Ot],l[vt]);c.detach(c.indexOf(e))}}let s=this._adjustIndex(t),o=this._lContainer;return Wo(o,r,s,i),e.attachToViewContainerRef(),f_(Nf(o),s,e),e}move(e,t){return this.insert(e,t)}indexOf(e){let t=Bw(this._lContainer);return t!==null?t.indexOf(e):-1}remove(e){let t=this._adjustIndex(e,-1),i=Ro(this._lContainer,t);i&&(dc(Nf(this._lContainer),t),$c(i[K],i))}detach(e){let t=this._adjustIndex(e,-1),i=Ro(this._lContainer,t);return i&&dc(Nf(this._lContainer),t)!=null?new Po(i):null}_adjustIndex(e,t=0){return e??this.length+t}};function Bw(n){return n[pc]}function Nf(n){return n[pc]||(n[pc]=[])}function mE(n,e){let t,i=e[n.index];return ri(i)?t=i:(t=oE(i,e,null,n),e[n.index]=t,vg(e,t)),xR(t,e,n,i),new gE(t,n,e)}function SR(n,e){let t=n[Ke],i=t.createComment(""),r=On(e,n),s=t.parentNode(r);return Ac(t,s,i,t.nextSibling(r),!1),i}var xR=MR,IR=()=>!1;function TR(n,e,t){return IR(n,e,t)}function MR(n,e,t,i){if(n[cr])return;let r;t.type&8?r=Mn(i):r=SR(e,t),n[cr]=r}var vp=class n{queryList;matches=null;constructor(e){this.queryList=e}clone(){return new n(this.queryList)}setDirty(){this.queryList.setDirty()}},yp=class n{queries;constructor(e=[]){this.queries=e}createEmbeddedView(e){let t=e.queries;if(t!==null){let i=e.contentQueries!==null?e.contentQueries[0]:t.length,r=[];for(let s=0;s0)i.push(o[a/2]);else{let c=s[a+1],u=e[-l];for(let d=mt;de.trim())}function jR(n,e,t){n.queries===null&&(n.queries=new wp),n.queries.track(new _p(e,t))}function Ig(n,e){return n.queries.getByIndex(e)}function BR(n,e){let t=n[K],i=Ig(t,e);return i.crossesNgTemplate?Ep(t,n,e,[]):vE(t,n,i,e)}var ms=class{},Tg=class{};var Cp=class extends ms{ngModuleType;_parent;_bootstrapComponents=[];_r3Injector;instance;destroyCbs=[];componentFactoryResolver=new Sc(this);constructor(e,t,i,r=!0){super(),this.ngModuleType=e,this._parent=t;let s=m_(e);this._bootstrapComponents=F0(s.bootstrap),this._r3Injector=i0(e,t,[{provide:ms,useValue:this},{provide:Gc,useValue:this.componentFactoryResolver},...i],Nt(e),new Set(["environment"])),r&&this.resolveInjectorInitializers()}resolveInjectorInitializers(){this._r3Injector.resolveInjectorInitializers(),this.instance=this._r3Injector.get(this.ngModuleType)}get injector(){return this._r3Injector}destroy(){let e=this._r3Injector;!e.destroyed&&e.destroy(),this.destroyCbs.forEach(t=>t()),this.destroyCbs=null}onDestroy(e){this.destroyCbs.push(e)}},Ap=class extends Tg{moduleType;constructor(e){super(),this.moduleType=e}create(e){return new Cp(this.moduleType,e,[])}};var xc=class extends ms{injector;componentFactoryResolver=new Sc(this);instance=null;constructor(e){super();let t=new So([...e.providers,{provide:ms,useValue:this},{provide:Gc,useValue:this.componentFactoryResolver}],e.parent||Gp(),e.debugName,new Set(["environment"]));this.injector=t,e.runEnvironmentInitializers&&t.resolveInjectorInitializers()}destroy(){this.injector.destroy()}onDestroy(e){this.injector.onDestroy(e)}};function qc(n,e,t=null){return new xc({providers:n,parent:e,debugName:t,runEnvironmentInitializers:!0}).injector}var UR=(()=>{class n{_injector;cachedInjectors=new Map;constructor(t){this._injector=t}getOrCreateStandaloneInjector(t){if(!t.standalone)return null;if(!this.cachedInjectors.has(t)){let i=v_(!1,t.type),r=i.length>0?qc([i],this._injector,`Standalone[${t.type.name}]`):null;this.cachedInjectors.set(t,r)}return this.cachedInjectors.get(t)}ngOnDestroy(){try{for(let t of this.cachedInjectors.values())t!==null&&t.destroy()}finally{this.cachedInjectors.clear()}}static \u0275prov=P({token:n,providedIn:"environment",factory:()=>new n(F(kt))})}return n})();function ye(n){return Oo(()=>{let e=yE(n),t=G(x({},e),{decls:n.decls,vars:n.vars,template:n.template,consts:n.consts||null,ngContentSelectors:n.ngContentSelectors,onPush:n.changeDetection===h0.OnPush,directiveDefs:null,pipeDefs:null,dependencies:e.standalone&&n.dependencies||null,getStandaloneInjector:e.standalone?r=>r.get(UR).getOrCreateStandaloneInjector(t):null,getExternalStyles:null,signals:n.signals??!1,data:n.data||{},encapsulation:n.encapsulation||kn.Emulated,styles:n.styles||rn,_:null,schemas:n.schemas||null,tView:null,id:""});e.standalone&&Ho("NgStandalone"),bE(t);let i=n.dependencies;return t.directiveDefs=Uw(i,!1),t.pipeDefs=Uw(i,!0),t.id=GR(t),t})}function HR(n){return os(n)||Xx(n)}function $R(n){return n!==null}function Gt(n){return Oo(()=>({type:n.type,bootstrap:n.bootstrap||rn,declarations:n.declarations||rn,imports:n.imports||rn,exports:n.exports||rn,transitiveCompileScopes:null,schemas:n.schemas||null,id:n.id||null}))}function zR(n,e){if(n==null)return or;let t={};for(let i in n)if(n.hasOwnProperty(i)){let r=n[i],s,o,a,l;Array.isArray(r)?(a=r[0],s=r[1],o=r[2]??s,l=r[3]||null):(s=r,o=r,a=Hc.None,l=null),t[s]=[i,a,l],e[s]=o}return t}function WR(n){if(n==null)return or;let e={};for(let t in n)n.hasOwnProperty(t)&&(e[n[t]]=t);return e}function We(n){return Oo(()=>{let e=yE(n);return bE(e),e})}function Yc(n){return{type:n.type,name:n.name,factory:null,pure:n.pure!==!1,standalone:n.standalone??!0,onDestroy:n.type.prototype.ngOnDestroy||null}}function yE(n){let e={};return{type:n.type,providersResolver:null,factory:null,hostBindings:n.hostBindings||null,hostVars:n.hostVars||0,hostAttrs:n.hostAttrs||null,contentQueries:n.contentQueries||null,declaredInputs:e,inputConfig:n.inputs||or,exportAs:n.exportAs||null,standalone:n.standalone??!0,signals:n.signals===!0,selectors:n.selectors||rn,viewQuery:n.viewQuery||null,features:n.features||null,setInput:null,findHostDirectiveDefs:null,hostDirectives:null,inputs:zR(n.inputs,e),outputs:WR(n.outputs),debugInfo:null}}function bE(n){n.features?.forEach(e=>e(n))}function Uw(n,e){if(!n)return null;let t=e?Kx:HR;return()=>(typeof n=="function"?n():n).map(i=>t(i)).filter($R)}function GR(n){let e=0,t=typeof n.consts=="function"?"":n.consts,i=[n.selectors,n.ngContentSelectors,n.hostVars,n.hostAttrs,t,n.vars,n.decls,n.encapsulation,n.standalone,n.signals,n.exportAs,JSON.stringify(n.inputs),JSON.stringify(n.outputs),Object.getOwnPropertyNames(n.type.prototype),!!n.contentQueries,!!n.viewQuery];for(let s of i.join("|"))e=Math.imul(31,e)+s.charCodeAt(0)<<0;return e+=2147483648,"c"+e}function qR(n){return Object.getPrototypeOf(n.prototype).constructor}function vn(n){let e=qR(n.type),t=!0,i=[n];for(;e;){let r;if(Tn(n))r=e.\u0275cmp||e.\u0275dir;else{if(e.\u0275cmp)throw new O(903,!1);r=e.\u0275dir}if(r){if(t){i.push(r);let o=n;o.inputs=kf(n.inputs),o.declaredInputs=kf(n.declaredInputs),o.outputs=kf(n.outputs);let a=r.hostBindings;a&&QR(n,a);let l=r.viewQuery,c=r.contentQueries;if(l&&KR(n,l),c&&ZR(n,c),YR(n,r),Ax(n.outputs,r.outputs),Tn(r)&&r.data.animation){let u=n.data;u.animation=(u.animation||[]).concat(r.data.animation)}}let s=r.features;if(s)for(let o=0;o=0;i--){let r=n[i];r.hostVars=e+=r.hostVars,r.hostAttrs=Io(r.hostAttrs,t=Io(t,r.hostAttrs))}}function kf(n){return n===or?{}:n===rn?[]:n}function KR(n,e){let t=n.viewQuery;t?n.viewQuery=(i,r)=>{e(i,r),t(i,r)}:n.viewQuery=e}function ZR(n,e){let t=n.contentQueries;t?n.contentQueries=(i,r,s)=>{e(i,r,s),t(i,r,s)}:n.contentQueries=e}function QR(n,e){let t=n.hostBindings;t?n.hostBindings=(i,r)=>{e(i,r),t(i,r)}:n.hostBindings=e}function wE(n){return eP(n)?Array.isArray(n)||!(n instanceof Map)&&Symbol.iterator in n:!1}function JR(n,e){if(Array.isArray(n))for(let t=0;t{class n{log(t){console.log(t)}warn(t){console.warn(t)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"platform"})}return n})();var CE=new L("");var AE=(()=>{class n{static \u0275prov=P({token:n,providedIn:"root",factory:()=>new Dp})}return n})(),Dp=class{queuedEffectCount=0;queues=new Map;schedule(e){this.enqueue(e)}remove(e){let t=e.zone,i=this.queues.get(t);i.has(e)&&(i.delete(e),this.queuedEffectCount--)}enqueue(e){let t=e.zone;this.queues.has(t)||this.queues.set(t,new Set);let i=this.queues.get(t);i.has(e)||(this.queuedEffectCount++,i.add(e))}flush(){for(;this.queuedEffectCount>0;)for(let[e,t]of this.queues)e===null?this.flushQueue(t):e.run(()=>this.flushQueue(t))}flushQueue(e){for(let t of e)e.delete(t),this.queuedEffectCount--,t.run()}};function wr(n){return!!n&&typeof n.then=="function"}function DE(n){return!!n&&typeof n.subscribe=="function"}var oP=new L("");var SE=(()=>{class n{resolve;reject;initialized=!1;done=!1;donePromise=new Promise((t,i)=>{this.resolve=t,this.reject=i});appInits=T(oP,{optional:!0})??[];injector=T(Pn);constructor(){}runInitializers(){if(this.initialized)return;let t=[];for(let r of this.appInits){let s=zt(this.injector,r);if(wr(s))t.push(s);else if(DE(s)){let o=new Promise((a,l)=>{s.subscribe({complete:a,error:l})});t.push(o)}}let i=()=>{this.done=!0,this.resolve()};Promise.all(t).then(()=>{i()}).catch(r=>{this.reject(r)}),t.length===0&&i(),this.initialized=!0}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Mg=new L("");function aP(){of(()=>{throw new O(600,!1)})}function lP(n){return n.isBoundToModule}var cP=10;var pr=(()=>{class n{_runningTick=!1;_destroyed=!1;_destroyListeners=[];_views=[];internalErrorHandler=T(sT);afterRenderManager=T(wT);zonelessEnabled=T(sg);rootEffectScheduler=T(AE);dirtyFlags=0;tracingSnapshot=null;externalTestViews=new Set;afterTick=new Se;get allViews(){return[...this.externalTestViews.keys(),...this._views]}get destroyed(){return this._destroyed}componentTypes=[];components=[];isStable=T(Ri).hasPendingTasks.pipe(z(t=>!t));constructor(){T(Bc,{optional:!0})}whenStable(){let t;return new Promise(i=>{t=this.isStable.subscribe({next:r=>{r&&i()}})}).finally(()=>{t.unsubscribe()})}_injector=T(kt);_rendererFactory=null;get injector(){return this._injector}bootstrap(t,i){return this.bootstrapImpl(t,i)}bootstrapImpl(t,i,r=Pn.NULL){Ie(10);let s=t instanceof uE;if(!this._injector.get(SE).done){let f="";throw new O(405,f)}let a;s?a=t:a=this._injector.get(Gc).resolveComponentFactory(t),this.componentTypes.push(a.componentType);let l=lP(a)?void 0:this._injector.get(ms),c=i||a.selector,u=a.create(r,[],c,l),d=u.location.nativeElement,h=u.injector.get(CE,null);return h?.registerApplication(d),u.onDestroy(()=>{this.detachView(u.hostView),oc(this.components,u),h?.unregisterApplication(d)}),this._loadComponent(u),Ie(11,u),u}tick(){this.zonelessEnabled||(this.dirtyFlags|=1),this._tick()}_tick(){Ie(12),this.tracingSnapshot!==null?this.tracingSnapshot.run(w0.CHANGE_DETECTION,this.tickImpl):this.tickImpl()}tickImpl=()=>{if(this._runningTick)throw new O(101,!1);let t=Z(null);try{this._runningTick=!0,this.synchronize()}catch(i){this.internalErrorHandler(i)}finally{this._runningTick=!1,this.tracingSnapshot?.dispose(),this.tracingSnapshot=null,Z(t),this.afterTick.next(),Ie(13)}};synchronize(){this._rendererFactory===null&&!this._injector.destroyed&&(this._rendererFactory=this._injector.get(gs,null,{optional:!0}));let t=0;for(;this.dirtyFlags!==0&&t++jc(t))){this.dirtyFlags|=2;return}else this.dirtyFlags&=-8}attachView(t){let i=t;this._views.push(i),i.attachToAppRef(this)}detachView(t){let i=t;oc(this._views,i),i.detachFromAppRef()}_loadComponent(t){this.attachView(t.hostView),this.tick(),this.components.push(t),this._injector.get(Mg,[]).forEach(r=>r(t))}ngOnDestroy(){if(!this._destroyed)try{this._destroyListeners.forEach(t=>t()),this._views.slice().forEach(t=>t.destroy())}finally{this._destroyed=!0,this._views=[],this._destroyListeners=[]}}onDestroy(t){return this._destroyListeners.push(t),()=>oc(this._destroyListeners,t)}destroy(){if(this._destroyed)throw new O(406,!1);let t=this._injector;t.destroy&&!t.destroyed&&t.destroy()}get viewCount(){return this._views.length}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function oc(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function uP(n,e,t,i){if(!t&&!jc(n))return;nE(n,e,t&&!i?0:1)}function Ds(n,e,t,i){let r=ee(),s=Es();if(on(r,s,e)){let o=ot(),a=tg();yM(a,r,n,e,t,i)}return Ds}function dP(n,e,t,i){return on(n,Es(),t)?e+Lo(t)+i:Pi}function tc(n,e){return n<<17|e<<2}function gr(n){return n>>17&32767}function hP(n){return(n&2)==2}function fP(n,e){return n&131071|e<<17}function Sp(n){return n|2}function vs(n){return(n&131068)>>2}function Of(n,e){return n&-131069|e<<2}function pP(n){return(n&1)===1}function xp(n){return n|1}function gP(n,e,t,i,r,s){let o=s?e.classBindings:e.styleBindings,a=gr(o),l=vs(o);n[i]=t;let c=!1,u;if(Array.isArray(t)){let d=t;u=d[1],(u===null||Fo(d,u)>0)&&(c=!0)}else u=t;if(r)if(l!==0){let h=gr(n[a+1]);n[i+1]=tc(h,a),h!==0&&(n[h+1]=Of(n[h+1],i)),n[a+1]=fP(n[a+1],i)}else n[i+1]=tc(a,0),a!==0&&(n[a+1]=Of(n[a+1],i)),a=i;else n[i+1]=tc(l,0),a===0?a=i:n[l+1]=Of(n[l+1],i),l=i;c&&(n[i+1]=Sp(n[i+1])),Hw(n,u,i,!0),Hw(n,u,i,!1),mP(e,u,n,i,s),o=tc(a,l),s?e.classBindings=o:e.styleBindings=o}function mP(n,e,t,i,r){let s=r?n.residualClasses:n.residualStyles;s!=null&&typeof e=="string"&&Fo(s,e)>=0&&(t[i+1]=xp(t[i+1]))}function Hw(n,e,t,i){let r=n[t+1],s=e===null,o=i?gr(r):vs(r),a=!1;for(;o!==0&&(a===!1||s);){let l=n[o],c=n[o+1];vP(l,e)&&(a=!0,n[o+1]=i?xp(c):Sp(c)),o=i?gr(c):vs(c)}a&&(n[t+1]=i?Sp(r):xp(r))}function vP(n,e){return n===null||e==null||(Array.isArray(n)?n[1]:n)===e?!0:Array.isArray(n)&&typeof e=="string"?Fo(n,e)>=0:!1}function W(n,e,t){let i=ee(),r=Es();if(on(i,r,e)){let s=ot(),o=tg();W0(s,o,i,n,e,i[Ke],t,!1)}return W}function $w(n,e,t,i,r){bg(e,n,t,r?"class":"style",i)}function Xc(n,e){return yP(n,e,null,!0),Xc}function yP(n,e,t,i){let r=ee(),s=ot(),o=II(2);if(s.firstUpdatePass&&wP(s,n,o,i),e!==Pi&&on(r,o,e)){let a=s.data[vr()];DP(s,a,r,r[Ke],n,r[o+1]=SP(e,t),i,o)}}function bP(n,e){return e>=n.expandoStartIndex}function wP(n,e,t,i){let r=n.data;if(r[t+1]===null){let s=r[vr()],o=bP(n,t);xP(s,i)&&e===null&&!o&&(e=!1),e=_P(r,s,e,i),gP(r,s,e,t,o,i)}}function _P(n,e,t,i){let r=PI(n),s=i?e.residualClasses:e.residualStyles;if(r===null)(i?e.classBindings:e.styleBindings)===0&&(t=Lf(null,n,e,t,i),t=ko(t,e.attrs,i),s=null);else{let o=e.directiveStylingLast;if(o===-1||n[o]!==r)if(t=Lf(r,n,e,t,i),s===null){let l=EP(n,e,i);l!==void 0&&Array.isArray(l)&&(l=Lf(null,n,e,l[1],i),l=ko(l,e.attrs,i),CP(n,e,i,l))}else s=AP(n,e,i)}return s!==void 0&&(i?e.residualClasses=s:e.residualStyles=s),t}function EP(n,e,t){let i=t?e.classBindings:e.styleBindings;if(vs(i)!==0)return n[gr(i)]}function CP(n,e,t,i){let r=t?e.classBindings:e.styleBindings;n[gr(r)]=i}function AP(n,e,t){let i,r=e.directiveEnd;for(let s=1+e.directiveStylingLast;s0;){let l=n[r],c=Array.isArray(l),u=c?l[1]:l,d=u===null,h=t[r+1];h===Pi&&(h=d?rn:void 0);let f=d?Df(h,i):u===i?h:void 0;if(c&&!Mc(f)&&(f=Df(l,i)),Mc(f)&&(a=f,o))return a;let p=n[r+1];r=o?gr(p):vs(p)}if(e!==null){let l=s?e.residualClasses:e.residualStyles;l!=null&&(a=Df(l,i))}return a}function Mc(n){return n!==void 0}function SP(n,e){return n==null||n===""||(typeof e=="string"?n=n+e:typeof n=="object"&&(n=Nt(dg(n)))),n}function xP(n,e){return(n.flags&(e?8:16))!==0}var Ip=class{destroy(e){}updateValue(e,t){}swap(e,t){let i=Math.min(e,t),r=Math.max(e,t),s=this.detach(r);if(r-i>1){let o=this.detach(i);this.attach(i,s),this.attach(r,o)}else this.attach(i,s)}move(e,t){this.attach(t,this.detach(e))}};function Ff(n,e,t,i,r){return n===t&&Object.is(e,i)?1:Object.is(r(n,e),r(t,i))?-1:0}function IP(n,e,t){let i,r,s=0,o=n.length-1,a=void 0;if(Array.isArray(e)){let l=e.length-1;for(;s<=o&&s<=l;){let c=n.at(s),u=e[s],d=Ff(s,c,s,u,t);if(d!==0){d<0&&n.updateValue(s,u),s++;continue}let h=n.at(o),f=e[l],p=Ff(o,h,l,f,t);if(p!==0){p<0&&n.updateValue(o,f),o--,l--;continue}let g=t(s,c),v=t(o,h),m=t(s,u);if(Object.is(m,v)){let y=t(l,f);Object.is(y,g)?(n.swap(s,o),n.updateValue(o,f),l--,o--):n.move(o,s),n.updateValue(s,u),s++;continue}if(i??=new Rc,r??=Gw(n,s,o,t),Tp(n,i,s,m))n.updateValue(s,u),s++,o++;else if(r.has(m))i.set(g,n.detach(s)),o--;else{let y=n.create(s,e[s]);n.attach(s,y),s++,o++}}for(;s<=l;)Ww(n,i,t,s,e[s]),s++}else if(e!=null){let l=e[Symbol.iterator](),c=l.next();for(;!c.done&&s<=o;){let u=n.at(s),d=c.value,h=Ff(s,u,s,d,t);if(h!==0)h<0&&n.updateValue(s,d),s++,c=l.next();else{i??=new Rc,r??=Gw(n,s,o,t);let f=t(s,d);if(Tp(n,i,s,f))n.updateValue(s,d),s++,o++,c=l.next();else if(!r.has(f))n.attach(s,n.create(s,d)),s++,o++,c=l.next();else{let p=t(s,u);i.set(p,n.detach(s)),o--}}}for(;!c.done;)Ww(n,i,t,n.length,c.value),c=l.next()}for(;s<=o;)n.destroy(n.detach(o--));i?.forEach(l=>{n.destroy(l)})}function Tp(n,e,t,i){return e!==void 0&&e.has(i)?(n.attach(t,e.get(i)),e.delete(i),!0):!1}function Ww(n,e,t,i,r){if(Tp(n,e,i,t(i,r)))n.updateValue(i,r);else{let s=n.create(i,r);n.attach(i,s)}}function Gw(n,e,t,i){let r=new Set;for(let s=e;s<=t;s++)r.add(i(s,n.at(s)));return r}var Rc=class{kvMap=new Map;_vMap=void 0;has(e){return this.kvMap.has(e)}delete(e){if(!this.has(e))return!1;let t=this.kvMap.get(e);return this._vMap!==void 0&&this._vMap.has(t)?(this.kvMap.set(e,this._vMap.get(t)),this._vMap.delete(t)):this.kvMap.delete(e),!0}get(e){return this.kvMap.get(e)}set(e,t){if(this.kvMap.has(e)){let i=this.kvMap.get(e);this._vMap===void 0&&(this._vMap=new Map);let r=this._vMap;for(;r.has(i);)i=r.get(i);r.set(i,t)}else this.kvMap.set(e,t)}forEach(e){for(let[t,i]of this.kvMap)if(e(i,t),this._vMap!==void 0){let r=this._vMap;for(;r.has(i);)i=r.get(i),e(i,t)}}};function ut(n,e){Ho("NgControlFlow");let t=ee(),i=Es(),r=t[i]!==Pi?t[i]:-1,s=r!==-1?Pc(t,yt+r):void 0,o=0;if(on(t,i,n)){let a=Z(null);try{if(s!==void 0&&lE(s,o),n!==-1){let l=yt+n,c=Pc(t,l),u=Np(t[K],l),d=ps(c,u.tView.ssrId),h=zo(t,u,e,{dehydratedView:d});Wo(c,h,o,fs(u,d))}}finally{Z(a)}}else if(s!==void 0){let a=aE(s,o);a!==void 0&&(a[tt]=e)}}var Mp=class{lContainer;$implicit;$index;constructor(e,t,i){this.lContainer=e,this.$implicit=t,this.$index=i}get $count(){return this.lContainer.length-mt}};function xE(n,e){return e}var Rp=class{hasEmptyBlock;trackByFn;liveCollection;constructor(e,t,i){this.hasEmptyBlock=e,this.trackByFn=t,this.liveCollection=i}};function IE(n,e,t,i,r,s,o,a,l,c,u,d,h){Ho("NgControlFlow");let f=ee(),p=ot(),g=l!==void 0,v=ee(),m=a?o.bind(v[Ht][tt]):o,y=new Rp(g,m);v[yt+n]=y,Tc(f,p,n+1,e,t,i,r,ds(p.consts,s)),g&&Tc(f,p,n+2,l,c,u,d,ds(p.consts,h))}var Pp=class extends Ip{lContainer;hostLView;templateTNode;operationsCounter=void 0;needsIndexUpdate=!1;constructor(e,t,i){super(),this.lContainer=e,this.hostLView=t,this.templateTNode=i}get length(){return this.lContainer.length-mt}at(e){return this.getLView(e)[tt].$implicit}attach(e,t){let i=t[ls];this.needsIndexUpdate||=e!==this.length,Wo(this.lContainer,t,e,fs(this.templateTNode,i))}detach(e){return this.needsIndexUpdate||=e!==this.length-1,TP(this.lContainer,e)}create(e,t){let i=ps(this.lContainer,this.templateTNode.tView.ssrId),r=zo(this.hostLView,this.templateTNode,new Mp(this.lContainer,t,e),{dehydratedView:i});return this.operationsCounter?.recordCreate(),r}destroy(e){$c(e[K],e),this.operationsCounter?.recordDestroy()}updateValue(e,t){this.getLView(e)[tt].$implicit=t}reset(){this.needsIndexUpdate=!1,this.operationsCounter?.reset()}updateIndexes(){if(this.needsIndexUpdate)for(let e=0;e(ig(!0),P0(i,r,OI()));function yn(){return ee()}var nr=void 0;function PP(n){let e=Math.floor(Math.abs(n)),t=n.toString().replace(/^[^.]*\.?/,"").length;return e===1&&t===0?1:5}var NP=["en",[["a","p"],["AM","PM"],nr],[["AM","PM"],nr,nr],[["S","M","T","W","T","F","S"],["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],["Su","Mo","Tu","We","Th","Fr","Sa"]],nr,[["J","F","M","A","M","J","J","A","S","O","N","D"],["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],["January","February","March","April","May","June","July","August","September","October","November","December"]],nr,[["B","A"],["BC","AD"],["Before Christ","Anno Domini"]],0,[6,0],["M/d/yy","MMM d, y","MMMM d, y","EEEE, MMMM d, y"],["h:mm a","h:mm:ss a","h:mm:ss a z","h:mm:ss a zzzz"],["{1}, {0}",nr,"{1} 'at' {0}",nr],[".",",",";","%","+","-","E","\xD7","\u2030","\u221E","NaN",":"],["#,##0.###","#,##0%","\xA4#,##0.00","#E0"],"USD","$","US Dollar",{},"ltr",PP],Vf={};function an(n){let e=kP(n),t=qw(e);if(t)return t;let i=e.split("-")[0];if(t=qw(i),t)return t;if(i==="en")return NP;throw new O(701,!1)}function qw(n){return n in Vf||(Vf[n]=Qn.ng&&Qn.ng.common&&Qn.ng.common.locales&&Qn.ng.common.locales[n]),Vf[n]}var Ge=function(n){return n[n.LocaleId=0]="LocaleId",n[n.DayPeriodsFormat=1]="DayPeriodsFormat",n[n.DayPeriodsStandalone=2]="DayPeriodsStandalone",n[n.DaysFormat=3]="DaysFormat",n[n.DaysStandalone=4]="DaysStandalone",n[n.MonthsFormat=5]="MonthsFormat",n[n.MonthsStandalone=6]="MonthsStandalone",n[n.Eras=7]="Eras",n[n.FirstDayOfWeek=8]="FirstDayOfWeek",n[n.WeekendRange=9]="WeekendRange",n[n.DateFormat=10]="DateFormat",n[n.TimeFormat=11]="TimeFormat",n[n.DateTimeFormat=12]="DateTimeFormat",n[n.NumberSymbols=13]="NumberSymbols",n[n.NumberFormats=14]="NumberFormats",n[n.CurrencyCode=15]="CurrencyCode",n[n.CurrencySymbol=16]="CurrencySymbol",n[n.CurrencyName=17]="CurrencyName",n[n.Currencies=18]="Currencies",n[n.Directionality=19]="Directionality",n[n.PluralCase=20]="PluralCase",n[n.ExtraData=21]="ExtraData",n}(Ge||{});function kP(n){return n.toLowerCase().replace(/_/g,"-")}var Nc="en-US";var OP=Nc;function LP(n){typeof n=="string"&&(OP=n.toLowerCase().replace(/_/g,"-"))}function Yw(n,e,t){return function i(r){if(r===Function)return t;let s=bs(n)?Rn(n.index,e):e;Sg(s,5);let o=e[tt],a=Xw(e,o,t,r),l=i.__ngNextListenerFn__;for(;l;)a=Xw(e,o,l,r)&&a,l=l.__ngNextListenerFn__;return a}}function Xw(n,e,t,i){let r=Z(null);try{return Ie(6,e,t),t(i)!==!1}catch(s){return FP(n,s),!1}finally{Ie(7,e,t),Z(r)}}function FP(n,e){let t=n[cs],i=t?t.get(Nn,null):null;i&&i.handleError(e)}function Kw(n,e,t,i,r,s){let o=e[t],a=e[K],c=a.data[t].outputs[i],u=o[c],d=a.firstCreatePass?Zp(a):null,h=Kp(e),f=u.subscribe(s),p=h.length;h.push(s,f),d&&d.push(r,n.index,p,-(p+1))}function me(n,e,t,i){let r=ee(),s=ot(),o=Wt();return ME(s,r,r[Ke],o,n,e,i),me}function VP(n,e,t,i){let r=n.cleanup;if(r!=null)for(let s=0;sl?a[l]:null}typeof o=="string"&&(s+=2)}return null}function ME(n,e,t,i,r,s,o){let a=qp(i),c=n.firstCreatePass?Zp(n):null,u=Kp(e),d=!0;if(i.type&3||o){let h=On(i,e),f=o?o(h):h,p=u.length,g=o?m=>o(Mn(m[i.index])):i.index,v=null;if(!o&&a&&(v=VP(n,e,r,i.index)),v!==null){let m=v.__ngLastListenerFn__||v;m.__ngNextListenerFn__=s,v.__ngLastListenerFn__=s,d=!1}else{s=Yw(i,e,s),ET(e,f,r,s);let m=t.listen(f,r,s);u.push(s,m),c&&c.push(r,g,p,p+1)}}else s=Yw(i,e,s);if(d){let h=i.outputs?.[r],f=i.hostDirectiveOutputs?.[r];if(f&&f.length)for(let p=0;p(ig(!0),zT(e[Ke],i));function Oe(n){return bn("",n,""),Oe}function bn(n,e,t){let i=ee(),r=dP(i,n,e,t);return r!==Pi&&HP(i,vr(),r),bn}function HP(n,e,t){let i=T_(e,n);WT(n[Ke],i,t)}function _r(n,e,t){u0(e)&&(e=e());let i=ee(),r=Es();if(on(i,r,e)){let s=ot(),o=tg();W0(s,o,i,n,e,i[Ke],t,!1)}return _r}function Ss(n,e){let t=u0(n);return t&&n.set(e),t}function Er(n,e){let t=ee(),i=ot(),r=Wt();return ME(i,t,t[Ke],r,n,e),Er}function $P(n,e,t){let i=ot();if(i.firstCreatePass){let r=Tn(n);kp(t,i.data,i.blueprint,r,!0),kp(e,i.data,i.blueprint,r,!1)}}function kp(n,e,t,i,r){if(n=Dt(n),Array.isArray(n))for(let s=0;s>20;if(as(n)||!n.multi){let f=new hr(c,r,j),p=Bf(l,e,r?u:u+h,d);p===-1?(Qf(wc(a,o),s,l),jf(s,n,e.length),e.push(l),a.directiveStart++,a.directiveEnd++,r&&(a.providerIndexes+=1048576),t.push(f),o.push(f)):(t[p]=f,o[p]=f)}else{let f=Bf(l,e,u+h,d),p=Bf(l,e,u,u+h),g=f>=0&&t[f],v=p>=0&&t[p];if(r&&!v||!r&&!g){Qf(wc(a,o),s,l);let m=GP(r?WP:zP,t.length,r,i,c);!r&&v&&(t[p].providerFactory=m),jf(s,n,e.length,0),e.push(l),a.directiveStart++,a.directiveEnd++,r&&(a.providerIndexes+=1048576),t.push(m),o.push(m)}else{let m=NE(t[r?p:f],c,!r&&i);jf(s,n,f>-1?f:p,m)}!r&&i&&v&&t[p].componentProviders++}}}function jf(n,e,t,i){let r=as(e),s=tI(e);if(r||s){let l=(s?Dt(e.useClass):e).prototype.ngOnDestroy;if(l){let c=n.destroyHooks||(n.destroyHooks=[]);if(!r&&e.multi){let u=c.indexOf(t);u===-1?c.push(t,[i,l]):c[u+1].push(i,l)}else c.push(t,l)}}}function NE(n,e,t){return t&&n.componentProviders++,n.multi.push(e)-1}function Bf(n,e,t,i){for(let r=t;r{t.providersResolver=(i,r)=>$P(i,r?r(n):n,e)}}function Jc(n,e,t,i){return LE(ee(),_s(),n,e,t,i)}function xs(n,e,t,i,r){return qP(ee(),_s(),n,e,t,i,r)}function kE(n,e,t,i,r,s){return YP(ee(),_s(),n,e,t,i,r,s)}function qo(n,e,t,i,r,s,o){return XP(ee(),_s(),n,e,t,i,r,s,o)}function OE(n,e,t,i,r,s,o,a){let l=_s()+n,c=ee(),u=_E(c,l,t,i,r,s);return on(c,l+4,o)||u?Go(c,l+5,a?e.call(a,t,i,r,s,o):e(t,i,r,s,o)):tP(c,l+5)}function eu(n,e){let t=n[e];return t===Pi?void 0:t}function LE(n,e,t,i,r,s){let o=e+t;return on(n,o,r)?Go(n,o+1,s?i.call(s,r):i(r)):eu(n,o+1)}function qP(n,e,t,i,r,s,o){let a=e+t;return Ic(n,a,r,s)?Go(n,a+2,o?i.call(o,r,s):i(r,s)):eu(n,a+2)}function YP(n,e,t,i,r,s,o,a){let l=e+t;return nP(n,l,r,s,o)?Go(n,l+3,a?i.call(a,r,s,o):i(r,s,o)):eu(n,l+3)}function XP(n,e,t,i,r,s,o,a,l){let c=e+t;return _E(n,c,r,s,o,a)?Go(n,c+4,l?i.call(l,r,s,o,a):i(r,s,o,a)):eu(n,c+4)}function dt(n,e){let t=ot(),i,r=n+yt;t.firstCreatePass?(i=KP(e,t.pipeRegistry),t.data[r]=i,i.onDestroy&&(t.destroyHooks??=[]).push(r,i.onDestroy)):i=t.data[r];let s=i.factory||(i.factory=sr(i.type,!0)),o,a=Pt(j);try{let l=bc(!1),c=s();return bc(l),gI(t,ee(),r,c),c}finally{Pt(a)}}function KP(n,e){if(e)for(let t=e.length-1;t>=0;t--){let i=e[t];if(n===i.name)return i}}function ht(n,e,t){let i=n+yt,r=ee(),s=pI(r,i);return ZP(r,i)?LE(r,_s(),e,s.transform,t,s):s.transform(t)}function ZP(n,e){return n[K].data[e].pure}var Lp=class{ngModuleFactory;componentFactories;constructor(e,t){this.ngModuleFactory=e,this.componentFactories=t}},FE=(()=>{class n{compileModuleSync(t){return new Ap(t)}compileModuleAsync(t){return Promise.resolve(this.compileModuleSync(t))}compileModuleAndAllComponentsSync(t){let i=this.compileModuleSync(t),r=m_(t),s=F0(r.declarations).reduce((o,a)=>{let l=os(a);return l&&o.push(new No(l)),o},[]);return new Lp(i,s)}compileModuleAndAllComponentsAsync(t){return Promise.resolve(this.compileModuleAndAllComponentsSync(t))}clearCache(){}clearCacheFor(t){}getModuleId(t){}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var QP=(()=>{class n{zone=T($e);changeDetectionScheduler=T(hs);applicationRef=T(pr);_onMicrotaskEmptySubscription;initialize(){this._onMicrotaskEmptySubscription||(this._onMicrotaskEmptySubscription=this.zone.onMicrotaskEmpty.subscribe({next:()=>{this.changeDetectionScheduler.runningTick||this.zone.run(()=>{this.applicationRef.tick()})}}))}ngOnDestroy(){this._onMicrotaskEmptySubscription?.unsubscribe()}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),JP=new L("",{factory:()=>!1});function VE({ngZoneFactory:n,ignoreChangesOutsideZone:e,scheduleInRootZone:t}){return n??=()=>new $e(G(x({},BE()),{scheduleInRootZone:t})),[{provide:$e,useFactory:n},{provide:Do,multi:!0,useFactory:()=>{let i=T(QP,{optional:!0});return()=>i.initialize()}},{provide:Do,multi:!0,useFactory:()=>{let i=T(eN);return()=>{i.initialize()}}},e===!0?{provide:s0,useValue:!0}:[],{provide:o0,useValue:t??r0}]}function jE(n){let e=n?.ignoreChangesOutsideZone,t=n?.scheduleInRootZone,i=VE({ngZoneFactory:()=>{let r=BE(n);return r.scheduleInRootZone=t,r.shouldCoalesceEventChangeDetection&&Ho("NgZone_CoalesceEvent"),new $e(r)},ignoreChangesOutsideZone:e,scheduleInRootZone:t});return mr([{provide:JP,useValue:!0},{provide:sg,useValue:!1},i])}function BE(n){return{enableLongStackTrace:!1,shouldCoalesceEventChangeDetection:n?.eventCoalescing??!1,shouldCoalesceRunChangeDetection:n?.runCoalescing??!1}}var eN=(()=>{class n{subscription=new je;initialized=!1;zone=T($e);pendingTasks=T(Ri);initialize(){if(this.initialized)return;this.initialized=!0;let t=null;!this.zone.isStable&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(t=this.pendingTasks.add()),this.zone.runOutsideAngular(()=>{this.subscription.add(this.zone.onStable.subscribe(()=>{$e.assertNotInAngularZone(),queueMicrotask(()=>{t!==null&&!this.zone.hasPendingMacrotasks&&!this.zone.hasPendingMicrotasks&&(this.pendingTasks.remove(t),t=null)})}))}),this.subscription.add(this.zone.onUnstable.subscribe(()=>{$e.assertInAngularZone(),t??=this.pendingTasks.add()}))}ngOnDestroy(){this.subscription.unsubscribe()}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var tN=(()=>{class n{appRef=T(pr);taskService=T(Ri);ngZone=T($e);zonelessEnabled=T(sg);tracing=T(Bc,{optional:!0});disableScheduling=T(s0,{optional:!0})??!1;zoneIsDefined=typeof Zone<"u"&&!!Zone.root.run;schedulerTickApplyArgs=[{data:{__scheduler_tick__:!0}}];subscriptions=new je;angularZoneId=this.zoneIsDefined?this.ngZone._inner?.get(Ec):null;scheduleInRootZone=!this.zonelessEnabled&&this.zoneIsDefined&&(T(o0,{optional:!0})??!1);cancelScheduledCallback=null;useMicrotaskScheduler=!1;runningTick=!1;pendingRenderTaskId=null;constructor(){this.subscriptions.add(this.appRef.afterTick.subscribe(()=>{this.runningTick||this.cleanup()})),this.subscriptions.add(this.ngZone.onUnstable.subscribe(()=>{this.runningTick||this.cleanup()})),this.disableScheduling||=!this.zonelessEnabled&&(this.ngZone instanceof np||!this.zoneIsDefined)}notify(t){if(!this.zonelessEnabled&&t===5)return;let i=!1;switch(t){case 0:{this.appRef.dirtyFlags|=2;break}case 3:case 2:case 4:case 5:case 1:{this.appRef.dirtyFlags|=4;break}case 6:{this.appRef.dirtyFlags|=2,i=!0;break}case 12:{this.appRef.dirtyFlags|=16,i=!0;break}case 13:{this.appRef.dirtyFlags|=2,i=!0;break}case 11:{i=!0;break}case 9:case 8:case 7:case 10:default:this.appRef.dirtyFlags|=8}if(this.appRef.tracingSnapshot=this.tracing?.snapshot(this.appRef.tracingSnapshot)??null,!this.shouldScheduleTick(i))return;let r=this.useMicrotaskScheduler?Ew:a0;this.pendingRenderTaskId=this.taskService.add(),this.scheduleInRootZone?this.cancelScheduledCallback=Zone.root.run(()=>r(()=>this.tick())):this.cancelScheduledCallback=this.ngZone.runOutsideAngular(()=>r(()=>this.tick()))}shouldScheduleTick(t){return!(this.disableScheduling&&!t||this.appRef.destroyed||this.pendingRenderTaskId!==null||this.runningTick||this.appRef._runningTick||!this.zonelessEnabled&&this.zoneIsDefined&&Zone.current.get(Ec+this.angularZoneId))}tick(){if(this.runningTick||this.appRef.destroyed)return;if(this.appRef.dirtyFlags===0){this.cleanup();return}!this.zonelessEnabled&&this.appRef.dirtyFlags&7&&(this.appRef.dirtyFlags|=1);let t=this.taskService.add();try{this.ngZone.run(()=>{this.runningTick=!0,this.appRef._tick()},void 0,this.schedulerTickApplyArgs)}catch(i){throw this.taskService.remove(t),i}finally{this.cleanup()}this.useMicrotaskScheduler=!0,Ew(()=>{this.useMicrotaskScheduler=!1,this.taskService.remove(t)})}ngOnDestroy(){this.subscriptions.unsubscribe(),this.cleanup()}cleanup(){if(this.runningTick=!1,this.cancelScheduledCallback?.(),this.cancelScheduledCallback=null,this.pendingRenderTaskId!==null){let t=this.pendingRenderTaskId;this.pendingRenderTaskId=null,this.taskService.remove(t)}}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function nN(){return typeof $localize<"u"&&$localize.locale||Nc}var tu=new L("",{providedIn:"root",factory:()=>T(tu,J.Optional|J.SkipSelf)||nN()});var Fp=new L(""),iN=new L("");function _o(n){return!n.moduleRef}function rN(n){let e=_o(n)?n.r3Injector:n.moduleRef.injector,t=e.get($e);return t.run(()=>{_o(n)?n.r3Injector.resolveInjectorInitializers():n.moduleRef.resolveInjectorInitializers();let i=e.get(Nn,null),r;if(t.runOutsideAngular(()=>{r=t.onError.subscribe({next:s=>{i.handleError(s)}})}),_o(n)){let s=()=>e.destroy(),o=n.platformInjector.get(Fp);o.add(s),e.onDestroy(()=>{r.unsubscribe(),o.delete(s)})}else{let s=()=>n.moduleRef.destroy(),o=n.platformInjector.get(Fp);o.add(s),n.moduleRef.onDestroy(()=>{oc(n.allPlatformModules,n.moduleRef),r.unsubscribe(),o.delete(s)})}return oN(i,t,()=>{let s=e.get(SE);return s.runInitializers(),s.donePromise.then(()=>{let o=e.get(tu,Nc);if(LP(o||Nc),!e.get(iN,!0))return _o(n)?e.get(pr):(n.allPlatformModules.push(n.moduleRef),n.moduleRef);if(_o(n)){let l=e.get(pr);return n.rootComponent!==void 0&&l.bootstrap(n.rootComponent),l}else return sN(n.moduleRef,n.allPlatformModules),n.moduleRef})})})}function sN(n,e){let t=n.injector.get(pr);if(n._bootstrapComponents.length>0)n._bootstrapComponents.forEach(i=>t.bootstrap(i));else if(n.instance.ngDoBootstrap)n.instance.ngDoBootstrap(t);else throw new O(-403,!1);e.push(n)}function oN(n,e,t){try{let i=t();return wr(i)?i.catch(r=>{throw e.runOutsideAngular(()=>n.handleError(r)),r}):i}catch(i){throw e.runOutsideAngular(()=>n.handleError(i)),i}}var ac=null;function aN(n=[],e){return Pn.create({name:e,providers:[{provide:Fc,useValue:"platform"},{provide:Fp,useValue:new Set([()=>ac=null])},...n]})}function lN(n=[]){if(ac)return ac;let e=aN(n);return ac=e,aP(),cN(e),e}function cN(n){let e=n.get(cg,null);zt(n,()=>{e?.forEach(t=>t())})}var Cr=(()=>{class n{static __NG_ELEMENT_ID__=uN}return n})();function uN(n){return dN(Wt(),ee(),(n&16)===16)}function dN(n,e,t){if(bs(n)&&!t){let i=Rn(n.index,e);return new Po(i,i)}else if(n.type&175){let i=e[Ht];return new Po(i,e)}return null}var Vp=class{constructor(){}supports(e){return wE(e)}create(e){return new jp(e)}},hN=(n,e)=>e,jp=class{length=0;collection;_linkedRecords=null;_unlinkedRecords=null;_previousItHead=null;_itHead=null;_itTail=null;_additionsHead=null;_additionsTail=null;_movesHead=null;_movesTail=null;_removalsHead=null;_removalsTail=null;_identityChangesHead=null;_identityChangesTail=null;_trackByFn;constructor(e){this._trackByFn=e||hN}forEachItem(e){let t;for(t=this._itHead;t!==null;t=t._next)e(t)}forEachOperation(e){let t=this._itHead,i=this._removalsHead,r=0,s=null;for(;t||i;){let o=!i||t&&t.currentIndex{o=this._trackByFn(r,a),t===null||!Object.is(t.trackById,o)?(t=this._mismatch(t,a,o,r),i=!0):(i&&(t=this._verifyReinsertion(t,a,o,r)),Object.is(t.item,a)||this._addIdentityChange(t,a)),t=t._next,r++}),this.length=r;return this._truncate(t),this.collection=e,this.isDirty}get isDirty(){return this._additionsHead!==null||this._movesHead!==null||this._removalsHead!==null||this._identityChangesHead!==null}_reset(){if(this.isDirty){let e;for(e=this._previousItHead=this._itHead;e!==null;e=e._next)e._nextPrevious=e._next;for(e=this._additionsHead;e!==null;e=e._nextAdded)e.previousIndex=e.currentIndex;for(this._additionsHead=this._additionsTail=null,e=this._movesHead;e!==null;e=e._nextMoved)e.previousIndex=e.currentIndex;this._movesHead=this._movesTail=null,this._removalsHead=this._removalsTail=null,this._identityChangesHead=this._identityChangesTail=null}}_mismatch(e,t,i,r){let s;return e===null?s=this._itTail:(s=e._prev,this._remove(e)),e=this._unlinkedRecords===null?null:this._unlinkedRecords.get(i,null),e!==null?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._reinsertAfter(e,s,r)):(e=this._linkedRecords===null?null:this._linkedRecords.get(i,r),e!==null?(Object.is(e.item,t)||this._addIdentityChange(e,t),this._moveAfter(e,s,r)):e=this._addAfter(new Bp(t,i),s,r)),e}_verifyReinsertion(e,t,i,r){let s=this._unlinkedRecords===null?null:this._unlinkedRecords.get(i,null);return s!==null?e=this._reinsertAfter(s,e._prev,r):e.currentIndex!=r&&(e.currentIndex=r,this._addToMoves(e,r)),e}_truncate(e){for(;e!==null;){let t=e._next;this._addToRemovals(this._unlink(e)),e=t}this._unlinkedRecords!==null&&this._unlinkedRecords.clear(),this._additionsTail!==null&&(this._additionsTail._nextAdded=null),this._movesTail!==null&&(this._movesTail._nextMoved=null),this._itTail!==null&&(this._itTail._next=null),this._removalsTail!==null&&(this._removalsTail._nextRemoved=null),this._identityChangesTail!==null&&(this._identityChangesTail._nextIdentityChange=null)}_reinsertAfter(e,t,i){this._unlinkedRecords!==null&&this._unlinkedRecords.remove(e);let r=e._prevRemoved,s=e._nextRemoved;return r===null?this._removalsHead=s:r._nextRemoved=s,s===null?this._removalsTail=r:s._prevRemoved=r,this._insertAfter(e,t,i),this._addToMoves(e,i),e}_moveAfter(e,t,i){return this._unlink(e),this._insertAfter(e,t,i),this._addToMoves(e,i),e}_addAfter(e,t,i){return this._insertAfter(e,t,i),this._additionsTail===null?this._additionsTail=this._additionsHead=e:this._additionsTail=this._additionsTail._nextAdded=e,e}_insertAfter(e,t,i){let r=t===null?this._itHead:t._next;return e._next=r,e._prev=t,r===null?this._itTail=e:r._prev=e,t===null?this._itHead=e:t._next=e,this._linkedRecords===null&&(this._linkedRecords=new kc),this._linkedRecords.put(e),e.currentIndex=i,e}_remove(e){return this._addToRemovals(this._unlink(e))}_unlink(e){this._linkedRecords!==null&&this._linkedRecords.remove(e);let t=e._prev,i=e._next;return t===null?this._itHead=i:t._next=i,i===null?this._itTail=t:i._prev=t,e}_addToMoves(e,t){return e.previousIndex===t||(this._movesTail===null?this._movesTail=this._movesHead=e:this._movesTail=this._movesTail._nextMoved=e),e}_addToRemovals(e){return this._unlinkedRecords===null&&(this._unlinkedRecords=new kc),this._unlinkedRecords.put(e),e.currentIndex=null,e._nextRemoved=null,this._removalsTail===null?(this._removalsTail=this._removalsHead=e,e._prevRemoved=null):(e._prevRemoved=this._removalsTail,this._removalsTail=this._removalsTail._nextRemoved=e),e}_addIdentityChange(e,t){return e.item=t,this._identityChangesTail===null?this._identityChangesTail=this._identityChangesHead=e:this._identityChangesTail=this._identityChangesTail._nextIdentityChange=e,e}},Bp=class{item;trackById;currentIndex=null;previousIndex=null;_nextPrevious=null;_prev=null;_next=null;_prevDup=null;_nextDup=null;_prevRemoved=null;_nextRemoved=null;_nextAdded=null;_nextMoved=null;_nextIdentityChange=null;constructor(e,t){this.item=e,this.trackById=t}},Up=class{_head=null;_tail=null;add(e){this._head===null?(this._head=this._tail=e,e._nextDup=null,e._prevDup=null):(this._tail._nextDup=e,e._prevDup=this._tail,e._nextDup=null,this._tail=e)}get(e,t){let i;for(i=this._head;i!==null;i=i._nextDup)if((t===null||t<=i.currentIndex)&&Object.is(i.trackById,e))return i;return null}remove(e){let t=e._prevDup,i=e._nextDup;return t===null?this._head=i:t._nextDup=i,i===null?this._tail=t:i._prevDup=t,this._head===null}},kc=class{map=new Map;put(e){let t=e.trackById,i=this.map.get(t);i||(i=new Up,this.map.set(t,i)),i.add(e)}get(e,t){let i=e,r=this.map.get(i);return r?r.get(e,t):null}remove(e){let t=e.trackById;return this.map.get(t).remove(e)&&this.map.delete(t),e}get isEmpty(){return this.map.size===0}clear(){this.map.clear()}};function Zw(n,e,t){let i=n.previousIndex;if(i===null)return i;let r=0;return t&&i{class n{factories;static \u0275prov=P({token:n,providedIn:"root",factory:Qw});constructor(t){this.factories=t}static create(t,i){if(i!=null){let r=i.factories.slice();t=t.concat(r)}return new n(t)}static extend(t){return{provide:n,useFactory:i=>n.create(t,i||Qw()),deps:[[n,new Hx,new Ux]]}}find(t){let i=this.factories.find(r=>r.supports(t));if(i!=null)return i;throw new O(901,!1)}}return n})();function UE(n){let{rootComponent:e,appProviders:t,platformProviders:i,platformRef:r}=n;Ie(8);try{let s=r?.injector??lN(i),o=[VE({}),{provide:hs,useExisting:tN},...t||[]],a=new xc({providers:o,parent:s,debugName:"",runEnvironmentInitializers:!1});return rN({r3Injector:a.injector,platformInjector:s,rootComponent:e})}catch(s){return Promise.reject(s)}finally{Ie(9)}}function Pg(n){return typeof n=="boolean"?n:n!=null&&n!=="false"}function li(n){return cf(n)}function Ar(n,e){return sf(n,e?.equal)}var Hp=class{[nn];constructor(e){this[nn]=e}destroy(){this[nn].destroy()}};function ki(n,e){!e?.injector&&aI(ki);let t=e?.injector??T(Pn),i=e?.manualCleanup!==!0?t.get(yr):null,r,s=t.get(_0,null,{optional:!0}),o=t.get(hs);s!==null&&!e?.forceRoot?(r=gN(s.view,o,n),i instanceof _c&&i._lView===s.view&&(i=null)):r=mN(n,t.get(AE),o),r.injector=t,i!==null&&(r.onDestroyFn=i.onDestroy(()=>r.destroy()));let a=new Hp(r);if(0)try{}finally{}return a}var HE=G(x({},Wr),{consumerIsAlwaysLive:!0,consumerAllowSignalWrites:!0,dirty:!0,hasRun:!1,cleanupFns:void 0,zone:null,kind:"effect",onDestroyFn:Mo,run(){if(this.dirty=!1,this.hasRun&&!wl(this))return;this.hasRun=!0;let n=i=>(this.cleanupFns??=[]).push(i),e=fo(this),t=mc(!1);try{this.maybeCleanup(),this.fn(n)}finally{mc(t),bl(this,e)}},maybeCleanup(){if(this.cleanupFns?.length)try{for(;this.cleanupFns.length;)this.cleanupFns.pop()()}finally{this.cleanupFns=[]}}}),fN=G(x({},HE),{consumerMarkedDirty(){this.scheduler.schedule(this),this.notifier.notify(12)},destroy(){po(this),this.onDestroyFn(),this.maybeCleanup(),this.scheduler.remove(this)}}),pN=G(x({},HE),{consumerMarkedDirty(){this.view[Y]|=8192,Vo(this.view),this.notifier.notify(13)},destroy(){po(this),this.onDestroyFn(),this.maybeCleanup(),this.view[lr]?.delete(this)}});function gN(n,e,t){let i=Object.create(pN);return i.view=n,i.zone=typeof Zone<"u"?Zone.current:null,i.notifier=e,i.fn=t,n[lr]??=new Set,n[lr].add(i),i.consumerMarkedDirty(i),i}function mN(n,e,t){let i=Object.create(fN);return i.fn=n,i.scheduler=e,i.notifier=t,i.zone=typeof Zone<"u"?Zone.current:null,i.scheduler.schedule(i),i.notifier.notify(12),i}var at=new L("");var WE=null;function ln(){return WE}function Ng(n){WE??=n}var Yo=class{},kg=(()=>{class n{historyGo(t){throw new Error("")}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:()=>T(GE),providedIn:"platform"})}return n})();var GE=(()=>{class n extends kg{_location;_history;_doc=T(at);constructor(){super(),this._location=window.location,this._history=window.history}getBaseHrefFromDOM(){return ln().getBaseHref(this._doc)}onPopState(t){let i=ln().getGlobalEventTarget(this._doc,"window");return i.addEventListener("popstate",t,!1),()=>i.removeEventListener("popstate",t)}onHashChange(t){let i=ln().getGlobalEventTarget(this._doc,"window");return i.addEventListener("hashchange",t,!1),()=>i.removeEventListener("hashchange",t)}get href(){return this._location.href}get protocol(){return this._location.protocol}get hostname(){return this._location.hostname}get port(){return this._location.port}get pathname(){return this._location.pathname}get search(){return this._location.search}get hash(){return this._location.hash}set pathname(t){this._location.pathname=t}pushState(t,i,r){this._history.pushState(t,i,r)}replaceState(t,i,r){this._history.replaceState(t,i,r)}forward(){this._history.forward()}back(){this._history.back()}historyGo(t=0){this._history.go(t)}getState(){return this._history.state}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:()=>new n,providedIn:"platform"})}return n})();function qE(n,e){return n?e?n.endsWith("/")?e.startsWith("/")?n+e.slice(1):n+e:e.startsWith("/")?n+e:`${n}/${e}`:n:e}function $E(n){let e=n.search(/#|\?|$/);return n[e-1]==="/"?n.slice(0,e-1)+n.slice(e):n}function Oi(n){return n&&n[0]!=="?"?`?${n}`:n}var nu=(()=>{class n{historyGo(t){throw new Error("")}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:()=>T(XE),providedIn:"root"})}return n})(),YE=new L(""),XE=(()=>{class n extends nu{_platformLocation;_baseHref;_removeListenerFns=[];constructor(t,i){super(),this._platformLocation=t,this._baseHref=i??this._platformLocation.getBaseHrefFromDOM()??T(at).location?.origin??""}ngOnDestroy(){for(;this._removeListenerFns.length;)this._removeListenerFns.pop()()}onPopState(t){this._removeListenerFns.push(this._platformLocation.onPopState(t),this._platformLocation.onHashChange(t))}getBaseHref(){return this._baseHref}prepareExternalUrl(t){return qE(this._baseHref,t)}path(t=!1){let i=this._platformLocation.pathname+Oi(this._platformLocation.search),r=this._platformLocation.hash;return r&&t?`${i}${r}`:i}pushState(t,i,r,s){let o=this.prepareExternalUrl(r+Oi(s));this._platformLocation.pushState(t,i,o)}replaceState(t,i,r,s){let o=this.prepareExternalUrl(r+Oi(s));this._platformLocation.replaceState(t,i,o)}forward(){this._platformLocation.forward()}back(){this._platformLocation.back()}getState(){return this._platformLocation.getState()}historyGo(t=0){this._platformLocation.historyGo?.(t)}static \u0275fac=function(i){return new(i||n)(F(kg),F(YE,8))};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Is=(()=>{class n{_subject=new Se;_basePath;_locationStrategy;_urlChangeListeners=[];_urlChangeSubscription=null;constructor(t){this._locationStrategy=t;let i=this._locationStrategy.getBaseHref();this._basePath=bN($E(zE(i))),this._locationStrategy.onPopState(r=>{this._subject.next({url:this.path(!0),pop:!0,state:r.state,type:r.type})})}ngOnDestroy(){this._urlChangeSubscription?.unsubscribe(),this._urlChangeListeners=[]}path(t=!1){return this.normalize(this._locationStrategy.path(t))}getState(){return this._locationStrategy.getState()}isCurrentPathEqualTo(t,i=""){return this.path()==this.normalize(t+Oi(i))}normalize(t){return n.stripTrailingSlash(yN(this._basePath,zE(t)))}prepareExternalUrl(t){return t&&t[0]!=="/"&&(t="/"+t),this._locationStrategy.prepareExternalUrl(t)}go(t,i="",r=null){this._locationStrategy.pushState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Oi(i)),r)}replaceState(t,i="",r=null){this._locationStrategy.replaceState(r,"",t,i),this._notifyUrlChangeListeners(this.prepareExternalUrl(t+Oi(i)),r)}forward(){this._locationStrategy.forward()}back(){this._locationStrategy.back()}historyGo(t=0){this._locationStrategy.historyGo?.(t)}onUrlChange(t){return this._urlChangeListeners.push(t),this._urlChangeSubscription??=this.subscribe(i=>{this._notifyUrlChangeListeners(i.url,i.state)}),()=>{let i=this._urlChangeListeners.indexOf(t);this._urlChangeListeners.splice(i,1),this._urlChangeListeners.length===0&&(this._urlChangeSubscription?.unsubscribe(),this._urlChangeSubscription=null)}}_notifyUrlChangeListeners(t="",i){this._urlChangeListeners.forEach(r=>r(t,i))}subscribe(t,i,r){return this._subject.subscribe({next:t,error:i??void 0,complete:r??void 0})}static normalizeQueryParams=Oi;static joinWithSlash=qE;static stripTrailingSlash=$E;static \u0275fac=function(i){return new(i||n)(F(nu))};static \u0275prov=P({token:n,factory:()=>vN(),providedIn:"root"})}return n})();function vN(){return new Is(F(nu))}function yN(n,e){if(!n||!e.startsWith(n))return e;let t=e.substring(n.length);return t===""||["/",";","?","#"].includes(t[0])?t:e}function zE(n){return n.replace(/\/index.html$/,"")}function bN(n){if(new RegExp("^(https?:)?//").test(n)){let[,t]=n.split(/\/\/[^\/]+/);return t}return n}var bt=function(n){return n[n.Format=0]="Format",n[n.Standalone=1]="Standalone",n}(bt||{}),Ce=function(n){return n[n.Narrow=0]="Narrow",n[n.Abbreviated=1]="Abbreviated",n[n.Wide=2]="Wide",n[n.Short=3]="Short",n}(Ce||{}),Ft=function(n){return n[n.Short=0]="Short",n[n.Medium=1]="Medium",n[n.Long=2]="Long",n[n.Full=3]="Full",n}(Ft||{}),ui={Decimal:0,Group:1,List:2,PercentSign:3,PlusSign:4,MinusSign:5,Exponential:6,SuperscriptingExponent:7,PerMille:8,Infinity:9,NaN:10,TimeSeparator:11,CurrencyDecimal:12,CurrencyGroup:13};function eC(n){return an(n)[Ge.LocaleId]}function tC(n,e,t){let i=an(n),r=[i[Ge.DayPeriodsFormat],i[Ge.DayPeriodsStandalone]],s=cn(r,e);return cn(s,t)}function nC(n,e,t){let i=an(n),r=[i[Ge.DaysFormat],i[Ge.DaysStandalone]],s=cn(r,e);return cn(s,t)}function iC(n,e,t){let i=an(n),r=[i[Ge.MonthsFormat],i[Ge.MonthsStandalone]],s=cn(r,e);return cn(s,t)}function rC(n,e){let i=an(n)[Ge.Eras];return cn(i,e)}function Xo(n,e){let t=an(n);return cn(t[Ge.DateFormat],e)}function Ko(n,e){let t=an(n);return cn(t[Ge.TimeFormat],e)}function Zo(n,e){let i=an(n)[Ge.DateTimeFormat];return cn(i,e)}function Qo(n,e){let t=an(n),i=t[Ge.NumberSymbols][e];if(typeof i>"u"){if(e===ui.CurrencyDecimal)return t[Ge.NumberSymbols][ui.Decimal];if(e===ui.CurrencyGroup)return t[Ge.NumberSymbols][ui.Group]}return i}function sC(n){if(!n[Ge.ExtraData])throw new Error(`Missing extra locale data for the locale "${n[Ge.LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`)}function oC(n){let e=an(n);return sC(e),(e[Ge.ExtraData][2]||[]).map(i=>typeof i=="string"?Og(i):[Og(i[0]),Og(i[1])])}function aC(n,e,t){let i=an(n);sC(i);let r=[i[Ge.ExtraData][0],i[Ge.ExtraData][1]],s=cn(r,e)||[];return cn(s,t)||[]}function cn(n,e){for(let t=e;t>-1;t--)if(typeof n[t]<"u")return n[t];throw new Error("Locale data API: locale data undefined")}function Og(n){let[e,t]=n.split(":");return{hours:+e,minutes:+t}}var wN=/^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/,iu={},_N=/((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;function lC(n,e,t,i){let r=MN(n);e=ci(t,e)||e;let o=[],a;for(;e;)if(a=_N.exec(e),a){o=o.concat(a.slice(1));let u=o.pop();if(!u)break;e=u}else{o.push(e);break}let l=r.getTimezoneOffset();i&&(l=uC(i,l),r=TN(r,i));let c="";return o.forEach(u=>{let d=xN(u);c+=d?d(r,t,l):u==="''"?"'":u.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),c}function lu(n,e,t){let i=new Date(0);return i.setFullYear(n,e,t),i.setHours(0,0,0),i}function ci(n,e){let t=eC(n);if(iu[t]??={},iu[t][e])return iu[t][e];let i="";switch(e){case"shortDate":i=Xo(n,Ft.Short);break;case"mediumDate":i=Xo(n,Ft.Medium);break;case"longDate":i=Xo(n,Ft.Long);break;case"fullDate":i=Xo(n,Ft.Full);break;case"shortTime":i=Ko(n,Ft.Short);break;case"mediumTime":i=Ko(n,Ft.Medium);break;case"longTime":i=Ko(n,Ft.Long);break;case"fullTime":i=Ko(n,Ft.Full);break;case"short":let r=ci(n,"shortTime"),s=ci(n,"shortDate");i=ru(Zo(n,Ft.Short),[r,s]);break;case"medium":let o=ci(n,"mediumTime"),a=ci(n,"mediumDate");i=ru(Zo(n,Ft.Medium),[o,a]);break;case"long":let l=ci(n,"longTime"),c=ci(n,"longDate");i=ru(Zo(n,Ft.Long),[l,c]);break;case"full":let u=ci(n,"fullTime"),d=ci(n,"fullDate");i=ru(Zo(n,Ft.Full),[u,d]);break}return i&&(iu[t][e]=i),i}function ru(n,e){return e&&(n=n.replace(/\{([^}]+)}/g,function(t,i){return e!=null&&i in e?e[i]:t})),n}function wn(n,e,t="-",i,r){let s="";(n<0||r&&n<=0)&&(r?n=-n+1:(n=-n,s=t));let o=String(n);for(;o.length0||a>-t)&&(a+=t),n===3)a===0&&t===-12&&(a=12);else if(n===6)return EN(a,e);let l=Qo(o,ui.MinusSign);return wn(a,e,l,i,r)}}function CN(n,e){switch(n){case 0:return e.getFullYear();case 1:return e.getMonth();case 2:return e.getDate();case 3:return e.getHours();case 4:return e.getMinutes();case 5:return e.getSeconds();case 6:return e.getMilliseconds();case 7:return e.getDay();default:throw new Error(`Unknown DateType value "${n}".`)}}function Te(n,e,t=bt.Format,i=!1){return function(r,s){return AN(r,s,n,e,t,i)}}function AN(n,e,t,i,r,s){switch(t){case 2:return iC(e,r,i)[n.getMonth()];case 1:return nC(e,r,i)[n.getDay()];case 0:let o=n.getHours(),a=n.getMinutes();if(s){let c=oC(e),u=aC(e,r,i),d=c.findIndex(h=>{if(Array.isArray(h)){let[f,p]=h,g=o>=f.hours&&a>=f.minutes,v=o0?Math.floor(r/60):Math.ceil(r/60);switch(n){case 0:return(r>=0?"+":"")+wn(o,2,s)+wn(Math.abs(r%60),2,s);case 1:return"GMT"+(r>=0?"+":"")+wn(o,1,s);case 2:return"GMT"+(r>=0?"+":"")+wn(o,2,s)+":"+wn(Math.abs(r%60),2,s);case 3:return i===0?"Z":(r>=0?"+":"")+wn(o,2,s)+":"+wn(Math.abs(r%60),2,s);default:throw new Error(`Unknown zone width "${n}"`)}}}var DN=0,au=4;function SN(n){let e=lu(n,DN,1).getDay();return lu(n,0,1+(e<=au?au:au+7)-e)}function cC(n){let e=n.getDay(),t=e===0?-3:au-e;return lu(n.getFullYear(),n.getMonth(),n.getDate()+t)}function Lg(n,e=!1){return function(t,i){let r;if(e){let s=new Date(t.getFullYear(),t.getMonth(),1).getDay()-1,o=t.getDate();r=1+Math.floor((o+s)/7)}else{let s=cC(t),o=SN(s.getFullYear()),a=s.getTime()-o.getTime();r=1+Math.round(a/6048e5)}return wn(r,n,Qo(i,ui.MinusSign))}}function ou(n,e=!1){return function(t,i){let s=cC(t).getFullYear();return wn(s,n,Qo(i,ui.MinusSign),e)}}var Fg={};function xN(n){if(Fg[n])return Fg[n];let e;switch(n){case"G":case"GG":case"GGG":e=Te(3,Ce.Abbreviated);break;case"GGGG":e=Te(3,Ce.Wide);break;case"GGGGG":e=Te(3,Ce.Narrow);break;case"y":e=Ze(0,1,0,!1,!0);break;case"yy":e=Ze(0,2,0,!0,!0);break;case"yyy":e=Ze(0,3,0,!1,!0);break;case"yyyy":e=Ze(0,4,0,!1,!0);break;case"Y":e=ou(1);break;case"YY":e=ou(2,!0);break;case"YYY":e=ou(3);break;case"YYYY":e=ou(4);break;case"M":case"L":e=Ze(1,1,1);break;case"MM":case"LL":e=Ze(1,2,1);break;case"MMM":e=Te(2,Ce.Abbreviated);break;case"MMMM":e=Te(2,Ce.Wide);break;case"MMMMM":e=Te(2,Ce.Narrow);break;case"LLL":e=Te(2,Ce.Abbreviated,bt.Standalone);break;case"LLLL":e=Te(2,Ce.Wide,bt.Standalone);break;case"LLLLL":e=Te(2,Ce.Narrow,bt.Standalone);break;case"w":e=Lg(1);break;case"ww":e=Lg(2);break;case"W":e=Lg(1,!0);break;case"d":e=Ze(2,1);break;case"dd":e=Ze(2,2);break;case"c":case"cc":e=Ze(7,1);break;case"ccc":e=Te(1,Ce.Abbreviated,bt.Standalone);break;case"cccc":e=Te(1,Ce.Wide,bt.Standalone);break;case"ccccc":e=Te(1,Ce.Narrow,bt.Standalone);break;case"cccccc":e=Te(1,Ce.Short,bt.Standalone);break;case"E":case"EE":case"EEE":e=Te(1,Ce.Abbreviated);break;case"EEEE":e=Te(1,Ce.Wide);break;case"EEEEE":e=Te(1,Ce.Narrow);break;case"EEEEEE":e=Te(1,Ce.Short);break;case"a":case"aa":case"aaa":e=Te(0,Ce.Abbreviated);break;case"aaaa":e=Te(0,Ce.Wide);break;case"aaaaa":e=Te(0,Ce.Narrow);break;case"b":case"bb":case"bbb":e=Te(0,Ce.Abbreviated,bt.Standalone,!0);break;case"bbbb":e=Te(0,Ce.Wide,bt.Standalone,!0);break;case"bbbbb":e=Te(0,Ce.Narrow,bt.Standalone,!0);break;case"B":case"BB":case"BBB":e=Te(0,Ce.Abbreviated,bt.Format,!0);break;case"BBBB":e=Te(0,Ce.Wide,bt.Format,!0);break;case"BBBBB":e=Te(0,Ce.Narrow,bt.Format,!0);break;case"h":e=Ze(3,1,-12);break;case"hh":e=Ze(3,2,-12);break;case"H":e=Ze(3,1);break;case"HH":e=Ze(3,2);break;case"m":e=Ze(4,1);break;case"mm":e=Ze(4,2);break;case"s":e=Ze(5,1);break;case"ss":e=Ze(5,2);break;case"S":e=Ze(6,1);break;case"SS":e=Ze(6,2);break;case"SSS":e=Ze(6,3);break;case"Z":case"ZZ":case"ZZZ":e=su(0);break;case"ZZZZZ":e=su(3);break;case"O":case"OO":case"OOO":case"z":case"zz":case"zzz":e=su(1);break;case"OOOO":case"ZZZZ":case"zzzz":e=su(2);break;default:return null}return Fg[n]=e,e}function uC(n,e){n=n.replace(/:/g,"");let t=Date.parse("Jan 01, 1970 00:00:00 "+n)/6e4;return isNaN(t)?e:t}function IN(n,e){return n=new Date(n.getTime()),n.setMinutes(n.getMinutes()+e),n}function TN(n,e,t){let r=n.getTimezoneOffset(),s=uC(e,r);return IN(n,-1*(s-r))}function MN(n){if(KE(n))return n;if(typeof n=="number"&&!isNaN(n))return new Date(n);if(typeof n=="string"){if(n=n.trim(),/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(n)){let[r,s=1,o=1]=n.split("-").map(a=>+a);return lu(r,s-1,o)}let t=parseFloat(n);if(!isNaN(n-t))return new Date(t);let i;if(i=n.match(wN))return RN(i)}let e=new Date(n);if(!KE(e))throw new Error(`Unable to convert "${n}" into a date`);return e}function RN(n){let e=new Date(0),t=0,i=0,r=n[8]?e.setUTCFullYear:e.setFullYear,s=n[8]?e.setUTCHours:e.setHours;n[9]&&(t=Number(n[9]+n[10]),i=Number(n[9]+n[11])),r.call(e,Number(n[1]),Number(n[2])-1,Number(n[3]));let o=Number(n[4]||0)-t,a=Number(n[5]||0)-i,l=Number(n[6]||0),c=Math.floor(parseFloat("0."+(n[7]||0))*1e3);return s.call(e,o,a,l,c),e}function KE(n){return n instanceof Date&&!isNaN(n.valueOf())}var Vg=/\s+/,ZE=[],qt=(()=>{class n{_ngEl;_renderer;initialClasses=ZE;rawClass;stateMap=new Map;constructor(t,i){this._ngEl=t,this._renderer=i}set klass(t){this.initialClasses=t!=null?t.trim().split(Vg):ZE}set ngClass(t){this.rawClass=typeof t=="string"?t.trim().split(Vg):t}ngDoCheck(){for(let i of this.initialClasses)this._updateState(i,!0);let t=this.rawClass;if(Array.isArray(t)||t instanceof Set)for(let i of t)this._updateState(i,!0);else if(t!=null)for(let i of Object.keys(t))this._updateState(i,!!t[i]);this._applyStateDiff()}_updateState(t,i){let r=this.stateMap.get(t);r!==void 0?(r.enabled!==i&&(r.changed=!0,r.enabled=i),r.touched=!0):this.stateMap.set(t,{enabled:i,changed:!0,touched:!0})}_applyStateDiff(){for(let t of this.stateMap){let i=t[0],r=t[1];r.changed?(this._toggleClass(i,r.enabled),r.changed=!1):r.touched||(r.enabled&&this._toggleClass(i,!1),this.stateMap.delete(i)),r.touched=!1}}_toggleClass(t,i){t=t.trim(),t.length>0&&t.split(Vg).forEach(r=>{i?this._renderer.addClass(this._ngEl.nativeElement,r):this._renderer.removeClass(this._ngEl.nativeElement,r)})}static \u0275fac=function(i){return new(i||n)(j(Lt),j(br))};static \u0275dir=We({type:n,selectors:[["","ngClass",""]],inputs:{klass:[0,"class","klass"],ngClass:"ngClass"}})}return n})();var cu=class{$implicit;ngForOf;index;count;constructor(e,t,i,r){this.$implicit=e,this.ngForOf=t,this.index=i,this.count=r}get first(){return this.index===0}get last(){return this.index===this.count-1}get even(){return this.index%2===0}get odd(){return!this.even}},Ts=(()=>{class n{_viewContainer;_template;_differs;set ngForOf(t){this._ngForOf=t,this._ngForOfDirty=!0}set ngForTrackBy(t){this._trackByFn=t}get ngForTrackBy(){return this._trackByFn}_ngForOf=null;_ngForOfDirty=!0;_differ=null;_trackByFn;constructor(t,i,r){this._viewContainer=t,this._template=i,this._differs=r}set ngForTemplate(t){t&&(this._template=t)}ngDoCheck(){if(this._ngForOfDirty){this._ngForOfDirty=!1;let t=this._ngForOf;if(!this._differ&&t)if(0)try{}catch{}else this._differ=this._differs.find(t).create(this.ngForTrackBy)}if(this._differ){let t=this._differ.diff(this._ngForOf);t&&this._applyChanges(t)}}_applyChanges(t){let i=this._viewContainer;t.forEachOperation((r,s,o)=>{if(r.previousIndex==null)i.createEmbeddedView(this._template,new cu(r.item,this._ngForOf,-1,-1),o===null?void 0:o);else if(o==null)i.remove(s===null?void 0:s);else if(s!==null){let a=i.get(s);i.move(a,o),QE(a,r)}});for(let r=0,s=i.length;r{let s=i.get(r.currentIndex);QE(s,r)})}static ngTemplateContextGuard(t,i){return!0}static \u0275fac=function(i){return new(i||n)(j(Ni),j(fr),j(Rg))};static \u0275dir=We({type:n,selectors:[["","ngFor","","ngForOf",""]],inputs:{ngForOf:"ngForOf",ngForTrackBy:"ngForTrackBy",ngForTemplate:"ngForTemplate"}})}return n})();function QE(n,e){n.context.$implicit=e.item}var jg=(()=>{class n{_viewContainer;_context=new uu;_thenTemplateRef=null;_elseTemplateRef=null;_thenViewRef=null;_elseViewRef=null;constructor(t,i){this._viewContainer=t,this._thenTemplateRef=i}set ngIf(t){this._context.$implicit=this._context.ngIf=t,this._updateView()}set ngIfThen(t){JE(t,!1),this._thenTemplateRef=t,this._thenViewRef=null,this._updateView()}set ngIfElse(t){JE(t,!1),this._elseTemplateRef=t,this._elseViewRef=null,this._updateView()}_updateView(){this._context.$implicit?this._thenViewRef||(this._viewContainer.clear(),this._elseViewRef=null,this._thenTemplateRef&&(this._thenViewRef=this._viewContainer.createEmbeddedView(this._thenTemplateRef,this._context))):this._elseViewRef||(this._viewContainer.clear(),this._thenViewRef=null,this._elseTemplateRef&&(this._elseViewRef=this._viewContainer.createEmbeddedView(this._elseTemplateRef,this._context)))}static ngIfUseIfTypeGuard;static ngTemplateGuard_ngIf;static ngTemplateContextGuard(t,i){return!0}static \u0275fac=function(i){return new(i||n)(j(Ni),j(fr))};static \u0275dir=We({type:n,selectors:[["","ngIf",""]],inputs:{ngIf:"ngIf",ngIfThen:"ngIfThen",ngIfElse:"ngIfElse"}})}return n})(),uu=class{$implicit=null;ngIf=null};function JE(n,e){if(n&&!n.createEmbeddedView)throw new O(2020,!1)}function PN(n,e){return new O(2100,!1)}var NN="mediumDate",dC=new L(""),hC=new L(""),Jo=(()=>{class n{locale;defaultTimezone;defaultOptions;constructor(t,i,r){this.locale=t,this.defaultTimezone=i,this.defaultOptions=r}transform(t,i,r,s){if(t==null||t===""||t!==t)return null;try{let o=i??this.defaultOptions?.dateFormat??NN,a=r??this.defaultOptions?.timezone??this.defaultTimezone??void 0;return lC(t,o,s||this.locale,a)}catch(o){throw PN(n,o.message)}}static \u0275fac=function(i){return new(i||n)(j(tu,16),j(dC,24),j(hC,24))};static \u0275pipe=Yc({name:"date",type:n,pure:!0})}return n})();var lt=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=Gt({type:n});static \u0275inj=$t({})}return n})();function ea(n,e){e=encodeURIComponent(e);for(let t of n.split(";")){let i=t.indexOf("="),[r,s]=i==-1?[t,""]:[t.slice(0,i),t.slice(i+1)];if(r.trim()===e)return decodeURIComponent(s)}return null}var Bg="browser",fC="server";function du(n){return n===fC}var Dr=class{};var pu=new L(""),zg=(()=>{class n{_zone;_plugins;_eventNameToPlugin=new Map;constructor(t,i){this._zone=i,t.forEach(r=>{r.manager=this}),this._plugins=t.slice().reverse()}addEventListener(t,i,r,s){return this._findPluginFor(i).addEventListener(t,i,r,s)}getZone(){return this._zone}_findPluginFor(t){let i=this._eventNameToPlugin.get(t);if(i)return i;if(i=this._plugins.find(s=>s.supports(t)),!i)throw new O(5101,!1);return this._eventNameToPlugin.set(t,i),i}static \u0275fac=function(i){return new(i||n)(F(pu),F($e))};static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})(),ta=class{_doc;constructor(e){this._doc=e}manager},hu="ng-app-id";function pC(n){for(let e of n)e.remove()}function gC(n,e){let t=e.createElement("style");return t.textContent=n,t}function kN(n,e,t,i){let r=n.head?.querySelectorAll(`style[${hu}="${e}"],link[${hu}="${e}"]`);if(r)for(let s of r)s.removeAttribute(hu),s instanceof HTMLLinkElement?i.set(s.href.slice(s.href.lastIndexOf("/")+1),{usage:0,elements:[s]}):s.textContent&&t.set(s.textContent,{usage:0,elements:[s]})}function Hg(n,e){let t=e.createElement("link");return t.setAttribute("rel","stylesheet"),t.setAttribute("href",n),t}var Wg=(()=>{class n{doc;appId;nonce;inline=new Map;external=new Map;hosts=new Set;isServer;constructor(t,i,r,s={}){this.doc=t,this.appId=i,this.nonce=r,this.isServer=du(s),kN(t,i,this.inline,this.external),this.hosts.add(t.head)}addStyles(t,i){for(let r of t)this.addUsage(r,this.inline,gC);i?.forEach(r=>this.addUsage(r,this.external,Hg))}removeStyles(t,i){for(let r of t)this.removeUsage(r,this.inline);i?.forEach(r=>this.removeUsage(r,this.external))}addUsage(t,i,r){let s=i.get(t);s?s.usage++:i.set(t,{usage:1,elements:[...this.hosts].map(o=>this.addElement(o,r(t,this.doc)))})}removeUsage(t,i){let r=i.get(t);r&&(r.usage--,r.usage<=0&&(pC(r.elements),i.delete(t)))}ngOnDestroy(){for(let[,{elements:t}]of[...this.inline,...this.external])pC(t);this.hosts.clear()}addHost(t){this.hosts.add(t);for(let[i,{elements:r}]of this.inline)r.push(this.addElement(t,gC(i,this.doc)));for(let[i,{elements:r}]of this.external)r.push(this.addElement(t,Hg(i,this.doc)))}removeHost(t){this.hosts.delete(t)}addElement(t,i){return this.nonce&&i.setAttribute("nonce",this.nonce),this.isServer&&i.setAttribute(hu,this.appId),t.appendChild(i)}static \u0275fac=function(i){return new(i||n)(F(at),F(lg),F(ug,8),F(Uo))};static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})(),Ug={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/",math:"http://www.w3.org/1998/Math/MathML"},Gg=/%COMP%/g;var vC="%COMP%",ON=`_nghost-${vC}`,LN=`_ngcontent-${vC}`,FN=!0,VN=new L("",{providedIn:"root",factory:()=>FN});function jN(n){return LN.replace(Gg,n)}function BN(n){return ON.replace(Gg,n)}function yC(n,e){return e.map(t=>t.replace(Gg,n))}var qg=(()=>{class n{eventManager;sharedStylesHost;appId;removeStylesOnCompDestroy;doc;platformId;ngZone;nonce;tracingService;rendererByCompId=new Map;defaultRenderer;platformIsServer;constructor(t,i,r,s,o,a,l,c=null,u=null){this.eventManager=t,this.sharedStylesHost=i,this.appId=r,this.removeStylesOnCompDestroy=s,this.doc=o,this.platformId=a,this.ngZone=l,this.nonce=c,this.tracingService=u,this.platformIsServer=du(a),this.defaultRenderer=new na(t,o,l,this.platformIsServer,this.tracingService)}createRenderer(t,i){if(!t||!i)return this.defaultRenderer;this.platformIsServer&&i.encapsulation===kn.ShadowDom&&(i=G(x({},i),{encapsulation:kn.Emulated}));let r=this.getOrCreateRenderer(t,i);return r instanceof fu?r.applyToHost(t):r instanceof ia&&r.applyStyles(),r}getOrCreateRenderer(t,i){let r=this.rendererByCompId,s=r.get(i.id);if(!s){let o=this.doc,a=this.ngZone,l=this.eventManager,c=this.sharedStylesHost,u=this.removeStylesOnCompDestroy,d=this.platformIsServer,h=this.tracingService;switch(i.encapsulation){case kn.Emulated:s=new fu(l,c,i,this.appId,u,o,a,d,h);break;case kn.ShadowDom:return new $g(l,c,t,i,o,a,this.nonce,d,h);default:s=new ia(l,c,i,u,o,a,d,h);break}r.set(i.id,s)}return s}ngOnDestroy(){this.rendererByCompId.clear()}componentReplaced(t){this.rendererByCompId.delete(t)}static \u0275fac=function(i){return new(i||n)(F(zg),F(Wg),F(lg),F(VN),F(at),F(Uo),F($e),F(ug),F(Bc,8))};static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})(),na=class{eventManager;doc;ngZone;platformIsServer;tracingService;data=Object.create(null);throwOnSyntheticProps=!0;constructor(e,t,i,r,s){this.eventManager=e,this.doc=t,this.ngZone=i,this.platformIsServer=r,this.tracingService=s}destroy(){}destroyNode=null;createElement(e,t){return t?this.doc.createElementNS(Ug[t]||t,e):this.doc.createElement(e)}createComment(e){return this.doc.createComment(e)}createText(e){return this.doc.createTextNode(e)}appendChild(e,t){(mC(e)?e.content:e).appendChild(t)}insertBefore(e,t,i){e&&(mC(e)?e.content:e).insertBefore(t,i)}removeChild(e,t){t.remove()}selectRootElement(e,t){let i=typeof e=="string"?this.doc.querySelector(e):e;if(!i)throw new O(-5104,!1);return t||(i.textContent=""),i}parentNode(e){return e.parentNode}nextSibling(e){return e.nextSibling}setAttribute(e,t,i,r){if(r){t=r+":"+t;let s=Ug[r];s?e.setAttributeNS(s,t,i):e.setAttribute(t,i)}else e.setAttribute(t,i)}removeAttribute(e,t,i){if(i){let r=Ug[i];r?e.removeAttributeNS(r,t):e.removeAttribute(`${i}:${t}`)}else e.removeAttribute(t)}addClass(e,t){e.classList.add(t)}removeClass(e,t){e.classList.remove(t)}setStyle(e,t,i,r){r&(ti.DashCase|ti.Important)?e.style.setProperty(t,i,r&ti.Important?"important":""):e.style[t]=i}removeStyle(e,t,i){i&ti.DashCase?e.style.removeProperty(t):e.style[t]=""}setProperty(e,t,i){e!=null&&(e[t]=i)}setValue(e,t){e.nodeValue=t}listen(e,t,i,r){if(typeof e=="string"&&(e=ln().getGlobalEventTarget(this.doc,e),!e))throw new O(5102,!1);let s=this.decoratePreventDefault(i);return this.tracingService?.wrapEventListener&&(s=this.tracingService.wrapEventListener(e,t,s)),this.eventManager.addEventListener(e,t,s,r)}decoratePreventDefault(e){return t=>{if(t==="__ngUnwrap__")return e;(this.platformIsServer?this.ngZone.runGuarded(()=>e(t)):e(t))===!1&&t.preventDefault()}}};function mC(n){return n.tagName==="TEMPLATE"&&n.content!==void 0}var $g=class extends na{sharedStylesHost;hostEl;shadowRoot;constructor(e,t,i,r,s,o,a,l,c){super(e,s,o,l,c),this.sharedStylesHost=t,this.hostEl=i,this.shadowRoot=i.attachShadow({mode:"open"}),this.sharedStylesHost.addHost(this.shadowRoot);let u=r.styles;u=yC(r.id,u);for(let h of u){let f=document.createElement("style");a&&f.setAttribute("nonce",a),f.textContent=h,this.shadowRoot.appendChild(f)}let d=r.getExternalStyles?.();if(d)for(let h of d){let f=Hg(h,s);a&&f.setAttribute("nonce",a),this.shadowRoot.appendChild(f)}}nodeOrShadowRoot(e){return e===this.hostEl?this.shadowRoot:e}appendChild(e,t){return super.appendChild(this.nodeOrShadowRoot(e),t)}insertBefore(e,t,i){return super.insertBefore(this.nodeOrShadowRoot(e),t,i)}removeChild(e,t){return super.removeChild(null,t)}parentNode(e){return this.nodeOrShadowRoot(super.parentNode(this.nodeOrShadowRoot(e)))}destroy(){this.sharedStylesHost.removeHost(this.shadowRoot)}},ia=class extends na{sharedStylesHost;removeStylesOnCompDestroy;styles;styleUrls;constructor(e,t,i,r,s,o,a,l,c){super(e,s,o,a,l),this.sharedStylesHost=t,this.removeStylesOnCompDestroy=r;let u=i.styles;this.styles=c?yC(c,u):u,this.styleUrls=i.getExternalStyles?.(c)}applyStyles(){this.sharedStylesHost.addStyles(this.styles,this.styleUrls)}destroy(){this.removeStylesOnCompDestroy&&this.sharedStylesHost.removeStyles(this.styles,this.styleUrls)}},fu=class extends ia{contentAttr;hostAttr;constructor(e,t,i,r,s,o,a,l,c){let u=r+"-"+i.id;super(e,t,i,s,o,a,l,c,u),this.contentAttr=jN(u),this.hostAttr=BN(u)}applyToHost(e){this.applyStyles(),this.setAttribute(e,this.hostAttr,"")}createElement(e,t){let i=super.createElement(e,t);return super.setAttribute(i,this.contentAttr,""),i}};var gu=class n extends Yo{supportsDOMEvents=!0;static makeCurrent(){Ng(new n)}onAndCancel(e,t,i,r){return e.addEventListener(t,i,r),()=>{e.removeEventListener(t,i,r)}}dispatchEvent(e,t){e.dispatchEvent(t)}remove(e){e.remove()}createElement(e,t){return t=t||this.getDefaultDocument(),t.createElement(e)}createHtmlDocument(){return document.implementation.createHTMLDocument("fakeTitle")}getDefaultDocument(){return document}isElementNode(e){return e.nodeType===Node.ELEMENT_NODE}isShadowRoot(e){return e instanceof DocumentFragment}getGlobalEventTarget(e,t){return t==="window"?window:t==="document"?e:t==="body"?e.body:null}getBaseHref(e){let t=UN();return t==null?null:HN(t)}resetBaseElement(){ra=null}getUserAgent(){return window.navigator.userAgent}getCookie(e){return ea(document.cookie,e)}},ra=null;function UN(){return ra=ra||document.head.querySelector("base"),ra?ra.getAttribute("href"):null}function HN(n){return new URL(n,document.baseURI).pathname}var $N=(()=>{class n{build(){return new XMLHttpRequest}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})(),wC=(()=>{class n extends ta{constructor(t){super(t)}supports(t){return!0}addEventListener(t,i,r,s){return t.addEventListener(i,r,s),()=>this.removeEventListener(t,i,r,s)}removeEventListener(t,i,r,s){return t.removeEventListener(i,r,s)}static \u0275fac=function(i){return new(i||n)(F(at))};static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})(),bC=["alt","control","meta","shift"],zN={"\b":"Backspace"," ":"Tab","\x7F":"Delete","\x1B":"Escape",Del:"Delete",Esc:"Escape",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Down:"ArrowDown",Menu:"ContextMenu",Scroll:"ScrollLock",Win:"OS"},WN={alt:n=>n.altKey,control:n=>n.ctrlKey,meta:n=>n.metaKey,shift:n=>n.shiftKey},_C=(()=>{class n extends ta{constructor(t){super(t)}supports(t){return n.parseEventName(t)!=null}addEventListener(t,i,r,s){let o=n.parseEventName(i),a=n.eventCallback(o.fullKey,r,this.manager.getZone());return this.manager.getZone().runOutsideAngular(()=>ln().onAndCancel(t,o.domEventName,a,s))}static parseEventName(t){let i=t.toLowerCase().split("."),r=i.shift();if(i.length===0||!(r==="keydown"||r==="keyup"))return null;let s=n._normalizeKey(i.pop()),o="",a=i.indexOf("code");if(a>-1&&(i.splice(a,1),o="code."),bC.forEach(c=>{let u=i.indexOf(c);u>-1&&(i.splice(u,1),o+=c+".")}),o+=s,i.length!=0||s.length===0)return null;let l={};return l.domEventName=r,l.fullKey=o,l}static matchEventFullKeyCode(t,i){let r=zN[t.key]||t.key,s="";return i.indexOf("code.")>-1&&(r=t.code,s="code."),r==null||!r?!1:(r=r.toLowerCase(),r===" "?r="space":r==="."&&(r="dot"),bC.forEach(o=>{if(o!==r){let a=WN[o];a(t)&&(s+=o+".")}}),s+=r,s===i)}static eventCallback(t,i,r){return s=>{n.matchEventFullKeyCode(s,t)&&r.runGuarded(()=>i(s))}}static _normalizeKey(t){return t==="esc"?"escape":t}static \u0275fac=function(i){return new(i||n)(F(at))};static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})();function Yg(n,e,t){return UE(x({rootComponent:n,platformRef:t?.platformRef},GN(e)))}function GN(n){return{appProviders:[...ZN,...n?.providers??[]],platformProviders:KN}}function qN(){gu.makeCurrent()}function YN(){return new Nn}function XN(){return v0(document),document}var KN=[{provide:Uo,useValue:Bg},{provide:cg,useValue:qN,multi:!0},{provide:at,useFactory:XN}];var ZN=[{provide:Fc,useValue:"root"},{provide:Nn,useFactory:YN},{provide:pu,useClass:wC,multi:!0,deps:[at]},{provide:pu,useClass:_C,multi:!0,deps:[at]},qg,Wg,zg,{provide:gs,useExisting:qg},{provide:Dr,useClass:$N},[]];var Ps=class{},sa=class{},Ln=class n{headers;normalizedNames=new Map;lazyInit;lazyUpdate=null;constructor(e){e?typeof e=="string"?this.lazyInit=()=>{this.headers=new Map,e.split(` `).forEach(t=>{let i=t.indexOf(":");if(i>0){let r=t.slice(0,i),s=t.slice(i+1).trim();this.addHeaderEntry(r,s)}})}:typeof Headers<"u"&&e instanceof Headers?(this.headers=new Map,e.forEach((t,i)=>{this.addHeaderEntry(i,t)})):this.lazyInit=()=>{this.headers=new Map,Object.entries(e).forEach(([t,i])=>{this.setHeaderEntries(t,i)})}:this.headers=new Map}has(e){return this.init(),this.headers.has(e.toLowerCase())}get(e){this.init();let t=this.headers.get(e.toLowerCase());return t&&t.length>0?t[0]:null}keys(){return this.init(),Array.from(this.normalizedNames.values())}getAll(e){return this.init(),this.headers.get(e.toLowerCase())||null}append(e,t){return this.clone({name:e,value:t,op:"a"})}set(e,t){return this.clone({name:e,value:t,op:"s"})}delete(e,t){return this.clone({name:e,value:t,op:"d"})}maybeSetNormalizedName(e,t){this.normalizedNames.has(t)||this.normalizedNames.set(t,e)}init(){this.lazyInit&&(this.lazyInit instanceof n?this.copyFrom(this.lazyInit):this.lazyInit(),this.lazyInit=null,this.lazyUpdate&&(this.lazyUpdate.forEach(e=>this.applyUpdate(e)),this.lazyUpdate=null))}copyFrom(e){e.init(),Array.from(e.headers.keys()).forEach(t=>{this.headers.set(t,e.headers.get(t)),this.normalizedNames.set(t,e.normalizedNames.get(t))})}clone(e){let t=new n;return t.lazyInit=this.lazyInit&&this.lazyInit instanceof n?this.lazyInit:this,t.lazyUpdate=(this.lazyUpdate||[]).concat([e]),t}applyUpdate(e){let t=e.name.toLowerCase();switch(e.op){case"a":case"s":let i=e.value;if(typeof i=="string"&&(i=[i]),i.length===0)return;this.maybeSetNormalizedName(e.name,t);let r=(e.op==="a"?this.headers.get(t):void 0)||[];r.push(...i),this.headers.set(t,r);break;case"d":let s=e.value;if(!s)this.headers.delete(t),this.normalizedNames.delete(t);else{let o=this.headers.get(t);if(!o)return;o=o.filter(a=>s.indexOf(a)===-1),o.length===0?(this.headers.delete(t),this.normalizedNames.delete(t)):this.headers.set(t,o)}break}}addHeaderEntry(e,t){let i=e.toLowerCase();this.maybeSetNormalizedName(e,i),this.headers.has(i)?this.headers.get(i).push(t):this.headers.set(i,[t])}setHeaderEntries(e,t){let i=(Array.isArray(t)?t:[t]).map(s=>s.toString()),r=e.toLowerCase();this.headers.set(r,i),this.maybeSetNormalizedName(e,r)}forEach(e){this.init(),Array.from(this.normalizedNames.keys()).forEach(t=>e(this.normalizedNames.get(t),this.headers.get(t)))}};var vu=class{encodeKey(e){return EC(e)}encodeValue(e){return EC(e)}decodeKey(e){return decodeURIComponent(e)}decodeValue(e){return decodeURIComponent(e)}};function QN(n,e){let t=new Map;return n.length>0&&n.replace(/^\?/,"").split("&").forEach(r=>{let s=r.indexOf("="),[o,a]=s==-1?[e.decodeKey(r),""]:[e.decodeKey(r.slice(0,s)),e.decodeValue(r.slice(s+1))],l=t.get(o)||[];l.push(a),t.set(o,l)}),t}var JN=/%(\d[a-f0-9])/gi,e1={40:"@","3A":":",24:"$","2C":",","3B":";","3D":"=","3F":"?","2F":"/"};function EC(n){return encodeURIComponent(n).replace(JN,(e,t)=>e1[t]??e)}function mu(n){return`${n}`}var _n=class n{map;encoder;updates=null;cloneFrom=null;constructor(e={}){if(this.encoder=e.encoder||new vu,e.fromString){if(e.fromObject)throw new O(2805,!1);this.map=QN(e.fromString,this.encoder)}else e.fromObject?(this.map=new Map,Object.keys(e.fromObject).forEach(t=>{let i=e.fromObject[t],r=Array.isArray(i)?i.map(mu):[mu(i)];this.map.set(t,r)})):this.map=null}has(e){return this.init(),this.map.has(e)}get(e){this.init();let t=this.map.get(e);return t?t[0]:null}getAll(e){return this.init(),this.map.get(e)||null}keys(){return this.init(),Array.from(this.map.keys())}append(e,t){return this.clone({param:e,value:t,op:"a"})}appendAll(e){let t=[];return Object.keys(e).forEach(i=>{let r=e[i];Array.isArray(r)?r.forEach(s=>{t.push({param:i,value:s,op:"a"})}):t.push({param:i,value:r,op:"a"})}),this.clone(t)}set(e,t){return this.clone({param:e,value:t,op:"s"})}delete(e,t){return this.clone({param:e,value:t,op:"d"})}toString(){return this.init(),this.keys().map(e=>{let t=this.encoder.encodeKey(e);return this.map.get(e).map(i=>t+"="+this.encoder.encodeValue(i)).join("&")}).filter(e=>e!=="").join("&")}clone(e){let t=new n({encoder:this.encoder});return t.cloneFrom=this.cloneFrom||this,t.updates=(this.updates||[]).concat(e),t}init(){this.map===null&&(this.map=new Map),this.cloneFrom!==null&&(this.cloneFrom.init(),this.cloneFrom.keys().forEach(e=>this.map.set(e,this.cloneFrom.map.get(e))),this.updates.forEach(e=>{switch(e.op){case"a":case"s":let t=(e.op==="a"?this.map.get(e.param):void 0)||[];t.push(mu(e.value)),this.map.set(e.param,t);break;case"d":if(e.value!==void 0){let i=this.map.get(e.param)||[],r=i.indexOf(mu(e.value));r!==-1&&i.splice(r,1),i.length>0?this.map.set(e.param,i):this.map.delete(e.param)}else{this.map.delete(e.param);break}}}),this.cloneFrom=this.updates=null)}};var yu=class{map=new Map;set(e,t){return this.map.set(e,t),this}get(e){return this.map.has(e)||this.map.set(e,e.defaultValue()),this.map.get(e)}delete(e){return this.map.delete(e),this}has(e){return this.map.has(e)}keys(){return this.map.keys()}};function t1(n){switch(n){case"DELETE":case"GET":case"HEAD":case"OPTIONS":case"JSONP":return!1;default:return!0}}function CC(n){return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer}function AC(n){return typeof Blob<"u"&&n instanceof Blob}function DC(n){return typeof FormData<"u"&&n instanceof FormData}function n1(n){return typeof URLSearchParams<"u"&&n instanceof URLSearchParams}var SC="Content-Type",xC="Accept",IC="X-Request-URL",TC="text/plain",MC="application/json",i1=`${MC}, ${TC}, */*`,Rs=class n{url;body=null;headers;context;reportProgress=!1;withCredentials=!1;responseType="json";method;params;urlWithParams;transferCache;constructor(e,t,i,r){this.url=t,this.method=e.toUpperCase();let s;if(t1(this.method)||r?(this.body=i!==void 0?i:null,s=r):s=i,s&&(this.reportProgress=!!s.reportProgress,this.withCredentials=!!s.withCredentials,s.responseType&&(this.responseType=s.responseType),s.headers&&(this.headers=s.headers),s.context&&(this.context=s.context),s.params&&(this.params=s.params),this.transferCache=s.transferCache),this.headers??=new Ln,this.context??=new yu,!this.params)this.params=new _n,this.urlWithParams=t;else{let o=this.params.toString();if(o.length===0)this.urlWithParams=t;else{let a=t.indexOf("?"),l=a===-1?"?":ah.set(f,e.setHeaders[f]),c)),e.setParams&&(u=Object.keys(e.setParams).reduce((h,f)=>h.set(f,e.setParams[f]),u)),new n(t,i,o,{params:u,headers:c,context:d,reportProgress:l,responseType:r,withCredentials:a,transferCache:s})}},di=function(n){return n[n.Sent=0]="Sent",n[n.UploadProgress=1]="UploadProgress",n[n.ResponseHeader=2]="ResponseHeader",n[n.DownloadProgress=3]="DownloadProgress",n[n.Response=4]="Response",n[n.User=5]="User",n}(di||{}),Ns=class{headers;status;statusText;url;ok;type;constructor(e,t=200,i="OK"){this.headers=e.headers||new Ln,this.status=e.status!==void 0?e.status:t,this.statusText=e.statusText||i,this.url=e.url||null,this.ok=this.status>=200&&this.status<300}},bu=class n extends Ns{constructor(e={}){super(e)}type=di.ResponseHeader;clone(e={}){return new n({headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}},oa=class n extends Ns{body;constructor(e={}){super(e),this.body=e.body!==void 0?e.body:null}type=di.Response;clone(e={}){return new n({body:e.body!==void 0?e.body:this.body,headers:e.headers||this.headers,status:e.status!==void 0?e.status:this.status,statusText:e.statusText||this.statusText,url:e.url||this.url||void 0})}},aa=class extends Ns{name="HttpErrorResponse";message;error;ok=!1;constructor(e){super(e,0,"Unknown Error"),this.status>=200&&this.status<300?this.message=`Http failure during parsing for ${e.url||"(unknown url)"}`:this.message=`Http failure response for ${e.url||"(unknown url)"}: ${e.status} ${e.statusText}`,this.error=e.error||null}},r1=200,s1=204;function Xg(n,e){return{body:e,headers:n.headers,context:n.context,observe:n.observe,params:n.params,reportProgress:n.reportProgress,responseType:n.responseType,withCredentials:n.withCredentials,transferCache:n.transferCache}}var Li=(()=>{class n{handler;constructor(t){this.handler=t}request(t,i,r={}){let s;if(t instanceof Rs)s=t;else{let l;r.headers instanceof Ln?l=r.headers:l=new Ln(r.headers);let c;r.params&&(r.params instanceof _n?c=r.params:c=new _n({fromObject:r.params})),s=new Rs(t,i,r.body!==void 0?r.body:null,{headers:l,context:r.context,params:c,reportProgress:r.reportProgress,responseType:r.responseType||"json",withCredentials:r.withCredentials,transferCache:r.transferCache})}let o=U(s).pipe(xn(l=>this.handler.handle(l)));if(t instanceof Rs||r.observe==="events")return o;let a=o.pipe(At(l=>l instanceof oa));switch(r.observe||"body"){case"body":switch(s.responseType){case"arraybuffer":return a.pipe(z(l=>{if(l.body!==null&&!(l.body instanceof ArrayBuffer))throw new O(2806,!1);return l.body}));case"blob":return a.pipe(z(l=>{if(l.body!==null&&!(l.body instanceof Blob))throw new O(2807,!1);return l.body}));case"text":return a.pipe(z(l=>{if(l.body!==null&&typeof l.body!="string")throw new O(2808,!1);return l.body}));case"json":default:return a.pipe(z(l=>l.body))}case"response":return a;default:throw new O(2809,!1)}}delete(t,i={}){return this.request("DELETE",t,i)}get(t,i={}){return this.request("GET",t,i)}head(t,i={}){return this.request("HEAD",t,i)}jsonp(t,i){return this.request("JSONP",t,{params:new _n().append(i,"JSONP_CALLBACK"),observe:"body",responseType:"json"})}options(t,i={}){return this.request("OPTIONS",t,i)}patch(t,i,r={}){return this.request("PATCH",t,Xg(r,i))}post(t,i,r={}){return this.request("POST",t,Xg(r,i))}put(t,i,r={}){return this.request("PUT",t,Xg(r,i))}static \u0275fac=function(i){return new(i||n)(F(Ps))};static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})();var o1=new L("");function a1(n,e){return e(n)}function l1(n,e,t){return(i,r)=>zt(t,()=>e(i,s=>n(s,r)))}var Zg=new L(""),RC=new L(""),PC=new L("",{providedIn:"root",factory:()=>!0});var wu=(()=>{class n extends Ps{backend;injector;chain=null;pendingTasks=T(Ri);contributeToStability=T(PC);constructor(t,i){super(),this.backend=t,this.injector=i}handle(t){if(this.chain===null){let i=Array.from(new Set([...this.injector.get(Zg),...this.injector.get(RC,[])]));this.chain=i.reduceRight((r,s)=>l1(r,s,this.injector),a1)}if(this.contributeToStability){let i=this.pendingTasks.add();return this.chain(t,r=>this.backend.handle(r)).pipe(tr(()=>this.pendingTasks.remove(i)))}else return this.chain(t,i=>this.backend.handle(i))}static \u0275fac=function(i){return new(i||n)(F(sa),F(kt))};static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})();var c1=/^\)\]\}',?\n/,u1=RegExp(`^${IC}:`,"m");function d1(n){return"responseURL"in n&&n.responseURL?n.responseURL:u1.test(n.getAllResponseHeaders())?n.getResponseHeader(IC):null}var Kg=(()=>{class n{xhrFactory;constructor(t){this.xhrFactory=t}handle(t){if(t.method==="JSONP")throw new O(-2800,!1);let i=this.xhrFactory;return(i.\u0275loadImpl?Ae(i.\u0275loadImpl()):U(null)).pipe(gt(()=>new ce(s=>{let o=i.build();if(o.open(t.method,t.urlWithParams),t.withCredentials&&(o.withCredentials=!0),t.headers.forEach((g,v)=>o.setRequestHeader(g,v.join(","))),t.headers.has(xC)||o.setRequestHeader(xC,i1),!t.headers.has(SC)){let g=t.detectContentTypeHeader();g!==null&&o.setRequestHeader(SC,g)}if(t.responseType){let g=t.responseType.toLowerCase();o.responseType=g!=="json"?g:"text"}let a=t.serializeBody(),l=null,c=()=>{if(l!==null)return l;let g=o.statusText||"OK",v=new Ln(o.getAllResponseHeaders()),m=d1(o)||t.url;return l=new bu({headers:v,status:o.status,statusText:g,url:m}),l},u=()=>{let{headers:g,status:v,statusText:m,url:y}=c(),b=null;v!==s1&&(b=typeof o.response>"u"?o.responseText:o.response),v===0&&(v=b?r1:0);let w=v>=200&&v<300;if(t.responseType==="json"&&typeof b=="string"){let E=b;b=b.replace(c1,"");try{b=b!==""?JSON.parse(b):null}catch(S){b=E,w&&(w=!1,b={error:S,text:b})}}w?(s.next(new oa({body:b,headers:g,status:v,statusText:m,url:y||void 0})),s.complete()):s.error(new aa({error:b,headers:g,status:v,statusText:m,url:y||void 0}))},d=g=>{let{url:v}=c(),m=new aa({error:g,status:o.status||0,statusText:o.statusText||"Unknown Error",url:v||void 0});s.error(m)},h=!1,f=g=>{h||(s.next(c()),h=!0);let v={type:di.DownloadProgress,loaded:g.loaded};g.lengthComputable&&(v.total=g.total),t.responseType==="text"&&o.responseText&&(v.partialText=o.responseText),s.next(v)},p=g=>{let v={type:di.UploadProgress,loaded:g.loaded};g.lengthComputable&&(v.total=g.total),s.next(v)};return o.addEventListener("load",u),o.addEventListener("error",d),o.addEventListener("timeout",d),o.addEventListener("abort",d),t.reportProgress&&(o.addEventListener("progress",f),a!==null&&o.upload&&o.upload.addEventListener("progress",p)),o.send(a),s.next({type:di.Sent}),()=>{o.removeEventListener("error",d),o.removeEventListener("abort",d),o.removeEventListener("load",u),o.removeEventListener("timeout",d),t.reportProgress&&(o.removeEventListener("progress",f),a!==null&&o.upload&&o.upload.removeEventListener("progress",p)),o.readyState!==o.DONE&&o.abort()}})))}static \u0275fac=function(i){return new(i||n)(F(Dr))};static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})(),NC=new L(""),h1="XSRF-TOKEN",f1=new L("",{providedIn:"root",factory:()=>h1}),p1="X-XSRF-TOKEN",g1=new L("",{providedIn:"root",factory:()=>p1}),la=class{},m1=(()=>{class n{doc;cookieName;lastCookieString="";lastToken=null;parseCount=0;constructor(t,i){this.doc=t,this.cookieName=i}getToken(){let t=this.doc.cookie||"";return t!==this.lastCookieString&&(this.parseCount++,this.lastToken=ea(t,this.cookieName),this.lastCookieString=t),this.lastToken}static \u0275fac=function(i){return new(i||n)(F(at),F(f1))};static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})(),v1=/^(?:https?:)?\/\//i;function y1(n,e){if(!T(NC)||n.method==="GET"||n.method==="HEAD"||v1.test(n.url))return e(n);let t=T(la).getToken(),i=T(g1);return t!=null&&!n.headers.has(i)&&(n=n.clone({headers:n.headers.set(i,t)})),e(n)}var Qg=function(n){return n[n.Interceptors=0]="Interceptors",n[n.LegacyInterceptors=1]="LegacyInterceptors",n[n.CustomXsrfConfiguration=2]="CustomXsrfConfiguration",n[n.NoXsrfProtection=3]="NoXsrfProtection",n[n.JsonpSupport=4]="JsonpSupport",n[n.RequestsMadeViaParent=5]="RequestsMadeViaParent",n[n.Fetch=6]="Fetch",n}(Qg||{});function b1(n,e){return{\u0275kind:n,\u0275providers:e}}function Jg(...n){let e=[Li,Kg,wu,{provide:Ps,useExisting:wu},{provide:sa,useFactory:()=>T(o1,{optional:!0})??T(Kg)},{provide:Zg,useValue:y1,multi:!0},{provide:NC,useValue:!0},{provide:la,useClass:m1}];for(let t of n)e.push(...t.\u0275providers);return mr(e)}function em(n){return b1(Qg.Interceptors,n.map(e=>({provide:Zg,useValue:e,multi:!0})))}var _u=(()=>{class n{_doc;constructor(t){this._doc=t}getTitle(){return this._doc.title}setTitle(t){this._doc.title=t||""}static \u0275fac=function(i){return new(i||n)(F(at))};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Q="primary",Ea=Symbol("RouteTitle"),sm=class{params;constructor(e){this.params=e||{}}has(e){return Object.prototype.hasOwnProperty.call(this.params,e)}get(e){if(this.has(e)){let t=this.params[e];return Array.isArray(t)?t[0]:t}return null}getAll(e){if(this.has(e)){let t=this.params[e];return Array.isArray(t)?t:[t]}return[]}get keys(){return Object.keys(this.params)}};function Ir(n){return new sm(n)}function $C(n,e,t){let i=t.path.split("/");if(i.length>n.length||t.pathMatch==="full"&&(e.hasChildren()||i.lengthi[s]===r)}else return n===e}function WC(n){return n.length>0?n[n.length-1]:null}function ji(n){return Yn(n)?n:wr(n)?Ae(Promise.resolve(n)):U(n)}var _1={exact:qC,subset:YC},GC={exact:E1,subset:C1,ignored:()=>!0};function LC(n,e,t){return _1[t.paths](n.root,e.root,t.matrixParams)&&GC[t.queryParams](n.queryParams,e.queryParams)&&!(t.fragment==="exact"&&n.fragment!==e.fragment)}function E1(n,e){return Fn(n,e)}function qC(n,e,t){if(!Sr(n.segments,e.segments)||!Au(n.segments,e.segments,t)||n.numberOfChildren!==e.numberOfChildren)return!1;for(let i in e.children)if(!n.children[i]||!qC(n.children[i],e.children[i],t))return!1;return!0}function C1(n,e){return Object.keys(e).length<=Object.keys(n).length&&Object.keys(e).every(t=>zC(n[t],e[t]))}function YC(n,e,t){return XC(n,e,e.segments,t)}function XC(n,e,t,i){if(n.segments.length>t.length){let r=n.segments.slice(0,t.length);return!(!Sr(r,t)||e.hasChildren()||!Au(r,t,i))}else if(n.segments.length===t.length){if(!Sr(n.segments,t)||!Au(n.segments,t,i))return!1;for(let r in e.children)if(!n.children[r]||!YC(n.children[r],e.children[r],i))return!1;return!0}else{let r=t.slice(0,n.segments.length),s=t.slice(n.segments.length);return!Sr(n.segments,r)||!Au(n.segments,r,i)||!n.children[Q]?!1:XC(n.children[Q],e,s,i)}}function Au(n,e,t){return e.every((i,r)=>GC[t](n[r].parameters,i.parameters))}var jn=class{root;queryParams;fragment;_queryParamMap;constructor(e=new we([],{}),t={},i=null){this.root=e,this.queryParams=t,this.fragment=i}get queryParamMap(){return this._queryParamMap??=Ir(this.queryParams),this._queryParamMap}toString(){return S1.serialize(this)}},we=class{segments;children;parent=null;constructor(e,t){this.segments=e,this.children=t,Object.values(t).forEach(i=>i.parent=this)}hasChildren(){return this.numberOfChildren>0}get numberOfChildren(){return Object.keys(this.children).length}toString(){return Du(this)}},Fi=class{path;parameters;_parameterMap;constructor(e,t){this.path=e,this.parameters=t}get parameterMap(){return this._parameterMap??=Ir(this.parameters),this._parameterMap}toString(){return ZC(this)}};function A1(n,e){return Sr(n,e)&&n.every((t,i)=>Fn(t.parameters,e[i].parameters))}function Sr(n,e){return n.length!==e.length?!1:n.every((t,i)=>t.path===e[i].path)}function D1(n,e){let t=[];return Object.entries(n.children).forEach(([i,r])=>{i===Q&&(t=t.concat(e(r,i)))}),Object.entries(n.children).forEach(([i,r])=>{i!==Q&&(t=t.concat(e(r,i)))}),t}var Ca=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:()=>new Tr,providedIn:"root"})}return n})(),Tr=class{parse(e){let t=new lm(e);return new jn(t.parseRootSegment(),t.parseQueryParams(),t.parseFragment())}serialize(e){let t=`/${ca(e.root,!0)}`,i=T1(e.queryParams),r=typeof e.fragment=="string"?`#${x1(e.fragment)}`:"";return`${t}${i}${r}`}},S1=new Tr;function Du(n){return n.segments.map(e=>ZC(e)).join("/")}function ca(n,e){if(!n.hasChildren())return Du(n);if(e){let t=n.children[Q]?ca(n.children[Q],!1):"",i=[];return Object.entries(n.children).forEach(([r,s])=>{r!==Q&&i.push(`${r}:${ca(s,!1)}`)}),i.length>0?`${t}(${i.join("//")})`:t}else{let t=D1(n,(i,r)=>r===Q?[ca(n.children[Q],!1)]:[`${r}:${ca(i,!1)}`]);return Object.keys(n.children).length===1&&n.children[Q]!=null?`${Du(n)}/${t[0]}`:`${Du(n)}/(${t.join("//")})`}}function KC(n){return encodeURIComponent(n).replace(/%40/g,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",")}function Eu(n){return KC(n).replace(/%3B/gi,";")}function x1(n){return encodeURI(n)}function am(n){return KC(n).replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/%26/gi,"&")}function Su(n){return decodeURIComponent(n)}function FC(n){return Su(n.replace(/\+/g,"%20"))}function ZC(n){return`${am(n.path)}${I1(n.parameters)}`}function I1(n){return Object.entries(n).map(([e,t])=>`;${am(e)}=${am(t)}`).join("")}function T1(n){let e=Object.entries(n).map(([t,i])=>Array.isArray(i)?i.map(r=>`${Eu(t)}=${Eu(r)}`).join("&"):`${Eu(t)}=${Eu(i)}`).filter(t=>t);return e.length?`?${e.join("&")}`:""}var M1=/^[^\/()?;#]+/;function tm(n){let e=n.match(M1);return e?e[0]:""}var R1=/^[^\/()?;=#]+/;function P1(n){let e=n.match(R1);return e?e[0]:""}var N1=/^[^=?&#]+/;function k1(n){let e=n.match(N1);return e?e[0]:""}var O1=/^[^&#]+/;function L1(n){let e=n.match(O1);return e?e[0]:""}var lm=class{url;remaining;constructor(e){this.url=e,this.remaining=e}parseRootSegment(){return this.consumeOptional("/"),this.remaining===""||this.peekStartsWith("?")||this.peekStartsWith("#")?new we([],{}):new we([],this.parseChildren())}parseQueryParams(){let e={};if(this.consumeOptional("?"))do this.parseQueryParam(e);while(this.consumeOptional("&"));return e}parseFragment(){return this.consumeOptional("#")?decodeURIComponent(this.remaining):null}parseChildren(){if(this.remaining==="")return{};this.consumeOptional("/");let e=[];for(this.peekStartsWith("(")||e.push(this.parseSegment());this.peekStartsWith("/")&&!this.peekStartsWith("//")&&!this.peekStartsWith("/(");)this.capture("/"),e.push(this.parseSegment());let t={};this.peekStartsWith("/(")&&(this.capture("/"),t=this.parseParens(!0));let i={};return this.peekStartsWith("(")&&(i=this.parseParens(!1)),(e.length>0||Object.keys(t).length>0)&&(i[Q]=new we(e,t)),i}parseSegment(){let e=tm(this.remaining);if(e===""&&this.peekStartsWith(";"))throw new O(4009,!1);return this.capture(e),new Fi(Su(e),this.parseMatrixParams())}parseMatrixParams(){let e={};for(;this.consumeOptional(";");)this.parseParam(e);return e}parseParam(e){let t=P1(this.remaining);if(!t)return;this.capture(t);let i="";if(this.consumeOptional("=")){let r=tm(this.remaining);r&&(i=r,this.capture(i))}e[Su(t)]=Su(i)}parseQueryParam(e){let t=k1(this.remaining);if(!t)return;this.capture(t);let i="";if(this.consumeOptional("=")){let o=L1(this.remaining);o&&(i=o,this.capture(i))}let r=FC(t),s=FC(i);if(e.hasOwnProperty(r)){let o=e[r];Array.isArray(o)||(o=[o],e[r]=o),o.push(s)}else e[r]=s}parseParens(e){let t={};for(this.capture("(");!this.consumeOptional(")")&&this.remaining.length>0;){let i=tm(this.remaining),r=this.remaining[i.length];if(r!=="/"&&r!==")"&&r!==";")throw new O(4010,!1);let s;i.indexOf(":")>-1?(s=i.slice(0,i.indexOf(":")),this.capture(s),this.capture(":")):e&&(s=Q);let o=this.parseChildren();t[s]=Object.keys(o).length===1?o[Q]:new we([],o),this.consumeOptional("//")}return t}peekStartsWith(e){return this.remaining.startsWith(e)}consumeOptional(e){return this.peekStartsWith(e)?(this.remaining=this.remaining.substring(e.length),!0):!1}capture(e){if(!this.consumeOptional(e))throw new O(4011,!1)}};function QC(n){return n.segments.length>0?new we([],{[Q]:n}):n}function JC(n){let e={};for(let[i,r]of Object.entries(n.children)){let s=JC(r);if(i===Q&&s.segments.length===0&&s.hasChildren())for(let[o,a]of Object.entries(s.children))e[o]=a;else(s.segments.length>0||s.hasChildren())&&(e[i]=s)}let t=new we(n.segments,e);return F1(t)}function F1(n){if(n.numberOfChildren===1&&n.children[Q]){let e=n.children[Q];return new we(n.segments.concat(e.segments),e.children)}return n}function Vs(n){return n instanceof jn}function eA(n,e,t=null,i=null){let r=tA(n);return nA(r,e,t,i)}function tA(n){let e;function t(s){let o={};for(let l of s.children){let c=t(l);o[l.outlet]=c}let a=new we(s.url,o);return s===n&&(e=a),a}let i=t(n.root),r=QC(i);return e??r}function nA(n,e,t,i){let r=n;for(;r.parent;)r=r.parent;if(e.length===0)return nm(r,r,r,t,i);let s=V1(e);if(s.toRoot())return nm(r,r,new we([],{}),t,i);let o=j1(s,r,n),a=o.processChildren?da(o.segmentGroup,o.index,s.commands):rA(o.segmentGroup,o.index,s.commands);return nm(r,o.segmentGroup,a,t,i)}function Iu(n){return typeof n=="object"&&n!=null&&!n.outlets&&!n.segmentPath}function fa(n){return typeof n=="object"&&n!=null&&n.outlets}function nm(n,e,t,i,r){let s={};i&&Object.entries(i).forEach(([l,c])=>{s[l]=Array.isArray(c)?c.map(u=>`${u}`):`${c}`});let o;n===e?o=t:o=iA(n,e,t);let a=QC(JC(o));return new jn(a,s,r)}function iA(n,e,t){let i={};return Object.entries(n.children).forEach(([r,s])=>{s===e?i[r]=t:i[r]=iA(s,e,t)}),new we(n.segments,i)}var Tu=class{isAbsolute;numberOfDoubleDots;commands;constructor(e,t,i){if(this.isAbsolute=e,this.numberOfDoubleDots=t,this.commands=i,e&&i.length>0&&Iu(i[0]))throw new O(4003,!1);let r=i.find(fa);if(r&&r!==WC(i))throw new O(4004,!1)}toRoot(){return this.isAbsolute&&this.commands.length===1&&this.commands[0]=="/"}};function V1(n){if(typeof n[0]=="string"&&n.length===1&&n[0]==="/")return new Tu(!0,0,n);let e=0,t=!1,i=n.reduce((r,s,o)=>{if(typeof s=="object"&&s!=null){if(s.outlets){let a={};return Object.entries(s.outlets).forEach(([l,c])=>{a[l]=typeof c=="string"?c.split("/"):c}),[...r,{outlets:a}]}if(s.segmentPath)return[...r,s.segmentPath]}return typeof s!="string"?[...r,s]:o===0?(s.split("/").forEach((a,l)=>{l==0&&a==="."||(l==0&&a===""?t=!0:a===".."?e++:a!=""&&r.push(a))}),r):[...r,s]},[]);return new Tu(t,e,i)}var Ls=class{segmentGroup;processChildren;index;constructor(e,t,i){this.segmentGroup=e,this.processChildren=t,this.index=i}};function j1(n,e,t){if(n.isAbsolute)return new Ls(e,!0,0);if(!t)return new Ls(e,!1,NaN);if(t.parent===null)return new Ls(t,!0,0);let i=Iu(n.commands[0])?0:1,r=t.segments.length-1+i;return B1(t,r,n.numberOfDoubleDots)}function B1(n,e,t){let i=n,r=e,s=t;for(;s>r;){if(s-=r,i=i.parent,!i)throw new O(4005,!1);r=i.segments.length}return new Ls(i,!1,r-s)}function U1(n){return fa(n[0])?n[0].outlets:{[Q]:n}}function rA(n,e,t){if(n??=new we([],{}),n.segments.length===0&&n.hasChildren())return da(n,e,t);let i=H1(n,e,t),r=t.slice(i.commandIndex);if(i.match&&i.pathIndexs!==Q)&&n.children[Q]&&n.numberOfChildren===1&&n.children[Q].segments.length===0){let s=da(n.children[Q],e,t);return new we(n.segments,s.children)}return Object.entries(i).forEach(([s,o])=>{typeof o=="string"&&(o=[o]),o!==null&&(r[s]=rA(n.children[s],e,o))}),Object.entries(n.children).forEach(([s,o])=>{i[s]===void 0&&(r[s]=o)}),new we(n.segments,r)}}function H1(n,e,t){let i=0,r=e,s={match:!1,pathIndex:0,commandIndex:0};for(;r=t.length)return s;let o=n.segments[r],a=t[i];if(fa(a))break;let l=`${a}`,c=i0&&l===void 0)break;if(l&&c&&typeof c=="object"&&c.outlets===void 0){if(!jC(l,c,o))return s;i+=2}else{if(!jC(l,{},o))return s;i++}r++}return{match:!0,pathIndex:r,commandIndex:i}}function cm(n,e,t){let i=n.segments.slice(0,e),r=0;for(;r{typeof i=="string"&&(i=[i]),i!==null&&(e[t]=cm(new we([],{}),0,i))}),e}function VC(n){let e={};return Object.entries(n).forEach(([t,i])=>e[t]=`${i}`),e}function jC(n,e,t){return n==t.path&&Fn(e,t.parameters)}var xu="imperative",ct=function(n){return n[n.NavigationStart=0]="NavigationStart",n[n.NavigationEnd=1]="NavigationEnd",n[n.NavigationCancel=2]="NavigationCancel",n[n.NavigationError=3]="NavigationError",n[n.RoutesRecognized=4]="RoutesRecognized",n[n.ResolveStart=5]="ResolveStart",n[n.ResolveEnd=6]="ResolveEnd",n[n.GuardsCheckStart=7]="GuardsCheckStart",n[n.GuardsCheckEnd=8]="GuardsCheckEnd",n[n.RouteConfigLoadStart=9]="RouteConfigLoadStart",n[n.RouteConfigLoadEnd=10]="RouteConfigLoadEnd",n[n.ChildActivationStart=11]="ChildActivationStart",n[n.ChildActivationEnd=12]="ChildActivationEnd",n[n.ActivationStart=13]="ActivationStart",n[n.ActivationEnd=14]="ActivationEnd",n[n.Scroll=15]="Scroll",n[n.NavigationSkipped=16]="NavigationSkipped",n}(ct||{}),Xt=class{id;url;constructor(e,t){this.id=e,this.url=t}},Mr=class extends Xt{type=ct.NavigationStart;navigationTrigger;restoredState;constructor(e,t,i="imperative",r=null){super(e,t),this.navigationTrigger=i,this.restoredState=r}toString(){return`NavigationStart(id: ${this.id}, url: '${this.url}')`}},hi=class extends Xt{urlAfterRedirects;type=ct.NavigationEnd;constructor(e,t,i){super(e,t),this.urlAfterRedirects=i}toString(){return`NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`}},Vt=function(n){return n[n.Redirect=0]="Redirect",n[n.SupersededByNewNavigation=1]="SupersededByNewNavigation",n[n.NoDataFromResolver=2]="NoDataFromResolver",n[n.GuardRejected=3]="GuardRejected",n}(Vt||{}),pa=function(n){return n[n.IgnoredSameUrlNavigation=0]="IgnoredSameUrlNavigation",n[n.IgnoredByUrlHandlingStrategy=1]="IgnoredByUrlHandlingStrategy",n}(pa||{}),Vn=class extends Xt{reason;code;type=ct.NavigationCancel;constructor(e,t,i,r){super(e,t),this.reason=i,this.code=r}toString(){return`NavigationCancel(id: ${this.id}, url: '${this.url}')`}},fi=class extends Xt{reason;code;type=ct.NavigationSkipped;constructor(e,t,i,r){super(e,t),this.reason=i,this.code=r}},js=class extends Xt{error;target;type=ct.NavigationError;constructor(e,t,i,r){super(e,t),this.error=i,this.target=r}toString(){return`NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`}},ga=class extends Xt{urlAfterRedirects;state;type=ct.RoutesRecognized;constructor(e,t,i,r){super(e,t),this.urlAfterRedirects=i,this.state=r}toString(){return`RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Mu=class extends Xt{urlAfterRedirects;state;type=ct.GuardsCheckStart;constructor(e,t,i,r){super(e,t),this.urlAfterRedirects=i,this.state=r}toString(){return`GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Ru=class extends Xt{urlAfterRedirects;state;shouldActivate;type=ct.GuardsCheckEnd;constructor(e,t,i,r,s){super(e,t),this.urlAfterRedirects=i,this.state=r,this.shouldActivate=s}toString(){return`GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`}},Pu=class extends Xt{urlAfterRedirects;state;type=ct.ResolveStart;constructor(e,t,i,r){super(e,t),this.urlAfterRedirects=i,this.state=r}toString(){return`ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},Nu=class extends Xt{urlAfterRedirects;state;type=ct.ResolveEnd;constructor(e,t,i,r){super(e,t),this.urlAfterRedirects=i,this.state=r}toString(){return`ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`}},ku=class{route;type=ct.RouteConfigLoadStart;constructor(e){this.route=e}toString(){return`RouteConfigLoadStart(path: ${this.route.path})`}},Ou=class{route;type=ct.RouteConfigLoadEnd;constructor(e){this.route=e}toString(){return`RouteConfigLoadEnd(path: ${this.route.path})`}},Lu=class{snapshot;type=ct.ChildActivationStart;constructor(e){this.snapshot=e}toString(){return`ChildActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Fu=class{snapshot;type=ct.ChildActivationEnd;constructor(e){this.snapshot=e}toString(){return`ChildActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},Vu=class{snapshot;type=ct.ActivationStart;constructor(e){this.snapshot=e}toString(){return`ActivationStart(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}},ju=class{snapshot;type=ct.ActivationEnd;constructor(e){this.snapshot=e}toString(){return`ActivationEnd(path: '${this.snapshot.routeConfig&&this.snapshot.routeConfig.path||""}')`}};var ma=class{},Bs=class{url;navigationBehaviorOptions;constructor(e,t){this.url=e,this.navigationBehaviorOptions=t}};function z1(n,e){return n.providers&&!n._injector&&(n._injector=qc(n.providers,e,`Route: ${n.path}`)),n._injector??e}function En(n){return n.outlet||Q}function W1(n,e){let t=n.filter(i=>En(i)===e);return t.push(...n.filter(i=>En(i)!==e)),t}function Aa(n){if(!n)return null;if(n.routeConfig?._injector)return n.routeConfig._injector;for(let e=n.parent;e;e=e.parent){let t=e.routeConfig;if(t?._loadedInjector)return t._loadedInjector;if(t?._injector)return t._injector}return null}var Bu=class{rootInjector;outlet=null;route=null;children;attachRef=null;get injector(){return Aa(this.route?.snapshot)??this.rootInjector}constructor(e){this.rootInjector=e,this.children=new $s(this.rootInjector)}},$s=(()=>{class n{rootInjector;contexts=new Map;constructor(t){this.rootInjector=t}onChildOutletCreated(t,i){let r=this.getOrCreateContext(t);r.outlet=i,this.contexts.set(t,r)}onChildOutletDestroyed(t){let i=this.getContext(t);i&&(i.outlet=null,i.attachRef=null)}onOutletDeactivated(){let t=this.contexts;return this.contexts=new Map,t}onOutletReAttached(t){this.contexts=t}getOrCreateContext(t){let i=this.getContext(t);return i||(i=new Bu(this.rootInjector),this.contexts.set(t,i)),i}getContext(t){return this.contexts.get(t)||null}static \u0275fac=function(i){return new(i||n)(F(kt))};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),Uu=class{_root;constructor(e){this._root=e}get root(){return this._root.value}parent(e){let t=this.pathFromRoot(e);return t.length>1?t[t.length-2]:null}children(e){let t=um(e,this._root);return t?t.children.map(i=>i.value):[]}firstChild(e){let t=um(e,this._root);return t&&t.children.length>0?t.children[0].value:null}siblings(e){let t=dm(e,this._root);return t.length<2?[]:t[t.length-2].children.map(r=>r.value).filter(r=>r!==e)}pathFromRoot(e){return dm(e,this._root).map(t=>t.value)}};function um(n,e){if(n===e.value)return e;for(let t of e.children){let i=um(n,t);if(i)return i}return null}function dm(n,e){if(n===e.value)return[e];for(let t of e.children){let i=dm(n,t);if(i.length)return i.unshift(e),i}return[]}var Yt=class{value;children;constructor(e,t){this.value=e,this.children=t}toString(){return`TreeNode(${this.value})`}};function Os(n){let e={};return n&&n.children.forEach(t=>e[t.value.outlet]=t),e}var va=class extends Uu{snapshot;constructor(e,t){super(e),this.snapshot=t,bm(this,e)}toString(){return this.snapshot.toString()}};function sA(n){let e=G1(n),t=new et([new Fi("",{})]),i=new et({}),r=new et({}),s=new et({}),o=new et(""),a=new Vi(t,i,s,o,r,Q,n,e.root);return a.snapshot=e.root,new va(new Yt(a,[]),e)}function G1(n){let e={},t={},i={},r="",s=new xr([],e,i,r,t,Q,n,null,{});return new ya("",new Yt(s,[]))}var Vi=class{urlSubject;paramsSubject;queryParamsSubject;fragmentSubject;dataSubject;outlet;component;snapshot;_futureSnapshot;_routerState;_paramMap;_queryParamMap;title;url;params;queryParams;fragment;data;constructor(e,t,i,r,s,o,a,l){this.urlSubject=e,this.paramsSubject=t,this.queryParamsSubject=i,this.fragmentSubject=r,this.dataSubject=s,this.outlet=o,this.component=a,this._futureSnapshot=l,this.title=this.dataSubject?.pipe(z(c=>c[Ea]))??U(void 0),this.url=e,this.params=t,this.queryParams=i,this.fragment=r,this.data=s}get routeConfig(){return this._futureSnapshot.routeConfig}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=this.params.pipe(z(e=>Ir(e))),this._paramMap}get queryParamMap(){return this._queryParamMap??=this.queryParams.pipe(z(e=>Ir(e))),this._queryParamMap}toString(){return this.snapshot?this.snapshot.toString():`Future(${this._futureSnapshot})`}};function Hu(n,e,t="emptyOnly"){let i,{routeConfig:r}=n;return e!==null&&(t==="always"||r?.path===""||!e.component&&!e.routeConfig?.loadComponent)?i={params:x(x({},e.params),n.params),data:x(x({},e.data),n.data),resolve:x(x(x(x({},n.data),e.data),r?.data),n._resolvedData)}:i={params:x({},n.params),data:x({},n.data),resolve:x(x({},n.data),n._resolvedData??{})},r&&aA(r)&&(i.resolve[Ea]=r.title),i}var xr=class{url;params;queryParams;fragment;data;outlet;component;routeConfig;_resolve;_resolvedData;_routerState;_paramMap;_queryParamMap;get title(){return this.data?.[Ea]}constructor(e,t,i,r,s,o,a,l,c){this.url=e,this.params=t,this.queryParams=i,this.fragment=r,this.data=s,this.outlet=o,this.component=a,this.routeConfig=l,this._resolve=c}get root(){return this._routerState.root}get parent(){return this._routerState.parent(this)}get firstChild(){return this._routerState.firstChild(this)}get children(){return this._routerState.children(this)}get pathFromRoot(){return this._routerState.pathFromRoot(this)}get paramMap(){return this._paramMap??=Ir(this.params),this._paramMap}get queryParamMap(){return this._queryParamMap??=Ir(this.queryParams),this._queryParamMap}toString(){let e=this.url.map(i=>i.toString()).join("/"),t=this.routeConfig?this.routeConfig.path:"";return`Route(url:'${e}', path:'${t}')`}},ya=class extends Uu{url;constructor(e,t){super(t),this.url=e,bm(this,t)}toString(){return oA(this._root)}};function bm(n,e){e.value._routerState=n,e.children.forEach(t=>bm(n,t))}function oA(n){let e=n.children.length>0?` { ${n.children.map(oA).join(", ")} } `:"";return`${n.value}${e}`}function im(n){if(n.snapshot){let e=n.snapshot,t=n._futureSnapshot;n.snapshot=t,Fn(e.queryParams,t.queryParams)||n.queryParamsSubject.next(t.queryParams),e.fragment!==t.fragment&&n.fragmentSubject.next(t.fragment),Fn(e.params,t.params)||n.paramsSubject.next(t.params),w1(e.url,t.url)||n.urlSubject.next(t.url),Fn(e.data,t.data)||n.dataSubject.next(t.data)}else n.snapshot=n._futureSnapshot,n.dataSubject.next(n._futureSnapshot.data)}function hm(n,e){let t=Fn(n.params,e.params)&&A1(n.url,e.url),i=!n.parent!=!e.parent;return t&&!i&&(!n.parent||hm(n.parent,e.parent))}function aA(n){return typeof n.title=="string"||n.title===null}var lA=new L(""),Da=(()=>{class n{activated=null;get activatedComponentRef(){return this.activated}_activatedRoute=null;name=Q;activateEvents=new oe;deactivateEvents=new oe;attachEvents=new oe;detachEvents=new oe;routerOutletData=Cs(void 0);parentContexts=T($s);location=T(Ni);changeDetector=T(Cr);inputBinder=T(Gu,{optional:!0});supportsBindingToComponentInputs=!0;ngOnChanges(t){if(t.name){let{firstChange:i,previousValue:r}=t.name;if(i)return;this.isTrackedInParentContexts(r)&&(this.deactivate(),this.parentContexts.onChildOutletDestroyed(r)),this.initializeOutletWithName()}}ngOnDestroy(){this.isTrackedInParentContexts(this.name)&&this.parentContexts.onChildOutletDestroyed(this.name),this.inputBinder?.unsubscribeFromRouteData(this)}isTrackedInParentContexts(t){return this.parentContexts.getContext(t)?.outlet===this}ngOnInit(){this.initializeOutletWithName()}initializeOutletWithName(){if(this.parentContexts.onChildOutletCreated(this.name,this),this.activated)return;let t=this.parentContexts.getContext(this.name);t?.route&&(t.attachRef?this.attach(t.attachRef,t.route):this.activateWith(t.route,t.injector))}get isActivated(){return!!this.activated}get component(){if(!this.activated)throw new O(4012,!1);return this.activated.instance}get activatedRoute(){if(!this.activated)throw new O(4012,!1);return this._activatedRoute}get activatedRouteData(){return this._activatedRoute?this._activatedRoute.snapshot.data:{}}detach(){if(!this.activated)throw new O(4012,!1);this.location.detach();let t=this.activated;return this.activated=null,this._activatedRoute=null,this.detachEvents.emit(t.instance),t}attach(t,i){this.activated=t,this._activatedRoute=i,this.location.insert(t.hostView),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.attachEvents.emit(t.instance)}deactivate(){if(this.activated){let t=this.component;this.activated.destroy(),this.activated=null,this._activatedRoute=null,this.deactivateEvents.emit(t)}}activateWith(t,i){if(this.isActivated)throw new O(4013,!1);this._activatedRoute=t;let r=this.location,o=t.snapshot.component,a=this.parentContexts.getOrCreateContext(this.name).children,l=new fm(t,a,r.injector,this.routerOutletData);this.activated=r.createComponent(o,{index:r.length,injector:l,environmentInjector:i}),this.changeDetector.markForCheck(),this.inputBinder?.bindActivatedRouteToOutletComponent(this),this.activateEvents.emit(this.activated.instance)}static \u0275fac=function(i){return new(i||n)};static \u0275dir=We({type:n,selectors:[["router-outlet"]],inputs:{name:"name",routerOutletData:[1,"routerOutletData"]},outputs:{activateEvents:"activate",deactivateEvents:"deactivate",attachEvents:"attach",detachEvents:"detach"},exportAs:["outlet"],features:[si]})}return n})(),fm=class{route;childContexts;parent;outletData;constructor(e,t,i,r){this.route=e,this.childContexts=t,this.parent=i,this.outletData=r}get(e,t){return e===Vi?this.route:e===$s?this.childContexts:e===lA?this.outletData:this.parent.get(e,t)}},Gu=new L("");var wm=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275cmp=ye({type:n,selectors:[["ng-component"]],exportAs:["emptyRouterOutlet"],decls:1,vars:0,template:function(i,r){i&1&&fe(0,"router-outlet")},dependencies:[Da],encapsulation:2})}return n})();function _m(n){let e=n.children&&n.children.map(_m),t=e?G(x({},n),{children:e}):x({},n);return!t.component&&!t.loadComponent&&(e||t.loadChildren)&&t.outlet&&t.outlet!==Q&&(t.component=wm),t}function q1(n,e,t){let i=ba(n,e._root,t?t._root:void 0);return new va(i,e)}function ba(n,e,t){if(t&&n.shouldReuseRoute(e.value,t.value.snapshot)){let i=t.value;i._futureSnapshot=e.value;let r=Y1(n,e,t);return new Yt(i,r)}else{if(n.shouldAttach(e.value)){let s=n.retrieve(e.value);if(s!==null){let o=s.route;return o.value._futureSnapshot=e.value,o.children=e.children.map(a=>ba(n,a)),o}}let i=X1(e.value),r=e.children.map(s=>ba(n,s));return new Yt(i,r)}}function Y1(n,e,t){return e.children.map(i=>{for(let r of t.children)if(n.shouldReuseRoute(i.value,r.value.snapshot))return ba(n,i,r);return ba(n,i)})}function X1(n){return new Vi(new et(n.url),new et(n.params),new et(n.queryParams),new et(n.fragment),new et(n.data),n.outlet,n.component,n)}var Us=class{redirectTo;navigationBehaviorOptions;constructor(e,t){this.redirectTo=e,this.navigationBehaviorOptions=t}},cA="ngNavigationCancelingError";function $u(n,e){let{redirectTo:t,navigationBehaviorOptions:i}=Vs(e)?{redirectTo:e,navigationBehaviorOptions:void 0}:e,r=uA(!1,Vt.Redirect);return r.url=t,r.navigationBehaviorOptions=i,r}function uA(n,e){let t=new Error(`NavigationCancelingError: ${n||""}`);return t[cA]=!0,t.cancellationCode=e,t}function K1(n){return dA(n)&&Vs(n.url)}function dA(n){return!!n&&n[cA]}var Z1=(n,e,t,i)=>z(r=>(new pm(e,r.targetRouterState,r.currentRouterState,t,i).activate(n),r)),pm=class{routeReuseStrategy;futureState;currState;forwardEvent;inputBindingEnabled;constructor(e,t,i,r,s){this.routeReuseStrategy=e,this.futureState=t,this.currState=i,this.forwardEvent=r,this.inputBindingEnabled=s}activate(e){let t=this.futureState._root,i=this.currState?this.currState._root:null;this.deactivateChildRoutes(t,i,e),im(this.futureState.root),this.activateChildRoutes(t,i,e)}deactivateChildRoutes(e,t,i){let r=Os(t);e.children.forEach(s=>{let o=s.value.outlet;this.deactivateRoutes(s,r[o],i),delete r[o]}),Object.values(r).forEach(s=>{this.deactivateRouteAndItsChildren(s,i)})}deactivateRoutes(e,t,i){let r=e.value,s=t?t.value:null;if(r===s)if(r.component){let o=i.getContext(r.outlet);o&&this.deactivateChildRoutes(e,t,o.children)}else this.deactivateChildRoutes(e,t,i);else s&&this.deactivateRouteAndItsChildren(t,i)}deactivateRouteAndItsChildren(e,t){e.value.component&&this.routeReuseStrategy.shouldDetach(e.value.snapshot)?this.detachAndStoreRouteSubtree(e,t):this.deactivateRouteAndOutlet(e,t)}detachAndStoreRouteSubtree(e,t){let i=t.getContext(e.value.outlet),r=i&&e.value.component?i.children:t,s=Os(e);for(let o of Object.values(s))this.deactivateRouteAndItsChildren(o,r);if(i&&i.outlet){let o=i.outlet.detach(),a=i.children.onOutletDeactivated();this.routeReuseStrategy.store(e.value.snapshot,{componentRef:o,route:e,contexts:a})}}deactivateRouteAndOutlet(e,t){let i=t.getContext(e.value.outlet),r=i&&e.value.component?i.children:t,s=Os(e);for(let o of Object.values(s))this.deactivateRouteAndItsChildren(o,r);i&&(i.outlet&&(i.outlet.deactivate(),i.children.onOutletDeactivated()),i.attachRef=null,i.route=null)}activateChildRoutes(e,t,i){let r=Os(t);e.children.forEach(s=>{this.activateRoutes(s,r[s.value.outlet],i),this.forwardEvent(new ju(s.value.snapshot))}),e.children.length&&this.forwardEvent(new Fu(e.value.snapshot))}activateRoutes(e,t,i){let r=e.value,s=t?t.value:null;if(im(r),r===s)if(r.component){let o=i.getOrCreateContext(r.outlet);this.activateChildRoutes(e,t,o.children)}else this.activateChildRoutes(e,t,i);else if(r.component){let o=i.getOrCreateContext(r.outlet);if(this.routeReuseStrategy.shouldAttach(r.snapshot)){let a=this.routeReuseStrategy.retrieve(r.snapshot);this.routeReuseStrategy.store(r.snapshot,null),o.children.onOutletReAttached(a.contexts),o.attachRef=a.componentRef,o.route=a.route.value,o.outlet&&o.outlet.attach(a.componentRef,a.route.value),im(a.route.value),this.activateChildRoutes(e,null,o.children)}else o.attachRef=null,o.route=r,o.outlet&&o.outlet.activateWith(r,o.injector),this.activateChildRoutes(e,null,o.children)}else this.activateChildRoutes(e,null,i)}},zu=class{path;route;constructor(e){this.path=e,this.route=this.path[this.path.length-1]}},Fs=class{component;route;constructor(e,t){this.component=e,this.route=t}};function Q1(n,e,t){let i=n._root,r=e?e._root:null;return ua(i,r,t,[i.value])}function J1(n){let e=n.routeConfig?n.routeConfig.canActivateChild:null;return!e||e.length===0?null:{node:n,guards:e}}function zs(n,e){let t=Symbol(),i=e.get(n,t);return i===t?typeof n=="function"&&!s_(n)?n:e.get(n):i}function ua(n,e,t,i,r={canDeactivateChecks:[],canActivateChecks:[]}){let s=Os(e);return n.children.forEach(o=>{ek(o,s[o.value.outlet],t,i.concat([o.value]),r),delete s[o.value.outlet]}),Object.entries(s).forEach(([o,a])=>ha(a,t.getContext(o),r)),r}function ek(n,e,t,i,r={canDeactivateChecks:[],canActivateChecks:[]}){let s=n.value,o=e?e.value:null,a=t?t.getContext(n.value.outlet):null;if(o&&s.routeConfig===o.routeConfig){let l=tk(o,s,s.routeConfig.runGuardsAndResolvers);l?r.canActivateChecks.push(new zu(i)):(s.data=o.data,s._resolvedData=o._resolvedData),s.component?ua(n,e,a?a.children:null,i,r):ua(n,e,t,i,r),l&&a&&a.outlet&&a.outlet.isActivated&&r.canDeactivateChecks.push(new Fs(a.outlet.component,o))}else o&&ha(e,a,r),r.canActivateChecks.push(new zu(i)),s.component?ua(n,null,a?a.children:null,i,r):ua(n,null,t,i,r);return r}function tk(n,e,t){if(typeof t=="function")return t(n,e);switch(t){case"pathParamsChange":return!Sr(n.url,e.url);case"pathParamsOrQueryParamsChange":return!Sr(n.url,e.url)||!Fn(n.queryParams,e.queryParams);case"always":return!0;case"paramsOrQueryParamsChange":return!hm(n,e)||!Fn(n.queryParams,e.queryParams);case"paramsChange":default:return!hm(n,e)}}function ha(n,e,t){let i=Os(n),r=n.value;Object.entries(i).forEach(([s,o])=>{r.component?e?ha(o,e.children.getContext(s),t):ha(o,null,t):ha(o,e,t)}),r.component?e&&e.outlet&&e.outlet.isActivated?t.canDeactivateChecks.push(new Fs(e.outlet.component,r)):t.canDeactivateChecks.push(new Fs(null,r)):t.canDeactivateChecks.push(new Fs(null,r))}function Sa(n){return typeof n=="function"}function nk(n){return typeof n=="boolean"}function ik(n){return n&&Sa(n.canLoad)}function rk(n){return n&&Sa(n.canActivate)}function sk(n){return n&&Sa(n.canActivateChild)}function ok(n){return n&&Sa(n.canDeactivate)}function ak(n){return n&&Sa(n.canMatch)}function hA(n){return n instanceof Xn||n?.name==="EmptyError"}var Cu=Symbol("INITIAL_VALUE");function Hs(){return gt(n=>Yl(n.map(e=>e.pipe(Rt(1),Af(Cu)))).pipe(z(e=>{for(let t of e)if(t!==!0){if(t===Cu)return Cu;if(t===!1||lk(t))return t}return!0}),At(e=>e!==Cu),Rt(1)))}function lk(n){return Vs(n)||n instanceof Us}function ck(n,e){return He(t=>{let{targetSnapshot:i,currentSnapshot:r,guards:{canActivateChecks:s,canDeactivateChecks:o}}=t;return o.length===0&&s.length===0?U(G(x({},t),{guardsResult:!0})):uk(o,i,r,n).pipe(He(a=>a&&nk(a)?dk(i,s,n,e):U(a)),z(a=>G(x({},t),{guardsResult:a})))})}function uk(n,e,t,i){return Ae(n).pipe(He(r=>mk(r.component,r.route,t,e,i)),Zn(r=>r!==!0,!0))}function dk(n,e,t,i){return Ae(e).pipe(xn(r=>Kn(fk(r.route.parent,i),hk(r.route,i),gk(n,r.path,t),pk(n,r.route,t))),Zn(r=>r!==!0,!0))}function hk(n,e){return n!==null&&e&&e(new Vu(n)),U(!0)}function fk(n,e){return n!==null&&e&&e(new Lu(n)),U(!0)}function pk(n,e,t){let i=e.routeConfig?e.routeConfig.canActivate:null;if(!i||i.length===0)return U(!0);let r=i.map(s=>er(()=>{let o=Aa(e)??t,a=zs(s,o),l=rk(a)?a.canActivate(e,n):zt(o,()=>a(e,n));return ji(l).pipe(Zn())}));return U(r).pipe(Hs())}function gk(n,e,t){let i=e[e.length-1],s=e.slice(0,e.length-1).reverse().map(o=>J1(o)).filter(o=>o!==null).map(o=>er(()=>{let a=o.guards.map(l=>{let c=Aa(o.node)??t,u=zs(l,c),d=sk(u)?u.canActivateChild(i,n):zt(c,()=>u(i,n));return ji(d).pipe(Zn())});return U(a).pipe(Hs())}));return U(s).pipe(Hs())}function mk(n,e,t,i,r){let s=e&&e.routeConfig?e.routeConfig.canDeactivate:null;if(!s||s.length===0)return U(!0);let o=s.map(a=>{let l=Aa(e)??r,c=zs(a,l),u=ok(c)?c.canDeactivate(n,e,t,i):zt(l,()=>c(n,e,t,i));return ji(u).pipe(Zn())});return U(o).pipe(Hs())}function vk(n,e,t,i){let r=e.canLoad;if(r===void 0||r.length===0)return U(!0);let s=r.map(o=>{let a=zs(o,n),l=ik(a)?a.canLoad(e,t):zt(n,()=>a(e,t));return ji(l)});return U(s).pipe(Hs(),fA(i))}function fA(n){return mf(Xe(e=>{if(typeof e!="boolean")throw $u(n,e)}),z(e=>e===!0))}function yk(n,e,t,i){let r=e.canMatch;if(!r||r.length===0)return U(!0);let s=r.map(o=>{let a=zs(o,n),l=ak(a)?a.canMatch(e,t):zt(n,()=>a(e,t));return ji(l)});return U(s).pipe(Hs(),fA(i))}var wa=class{segmentGroup;constructor(e){this.segmentGroup=e||null}},_a=class extends Error{urlTree;constructor(e){super(),this.urlTree=e}};function ks(n){return xi(new wa(n))}function bk(n){return xi(new O(4e3,!1))}function wk(n){return xi(uA(!1,Vt.GuardRejected))}var gm=class{urlSerializer;urlTree;constructor(e,t){this.urlSerializer=e,this.urlTree=t}lineralizeSegments(e,t){let i=[],r=t.root;for(;;){if(i=i.concat(r.segments),r.numberOfChildren===0)return U(i);if(r.numberOfChildren>1||!r.children[Q])return bk(`${e.redirectTo}`);r=r.children[Q]}}applyRedirectCommands(e,t,i,r,s){if(typeof t!="string"){let a=t,{queryParams:l,fragment:c,routeConfig:u,url:d,outlet:h,params:f,data:p,title:g}=r,v=zt(s,()=>a({params:f,data:p,queryParams:l,fragment:c,routeConfig:u,url:d,outlet:h,title:g}));if(v instanceof jn)throw new _a(v);t=v}let o=this.applyRedirectCreateUrlTree(t,this.urlSerializer.parse(t),e,i);if(t[0]==="/")throw new _a(o);return o}applyRedirectCreateUrlTree(e,t,i,r){let s=this.createSegmentGroup(e,t.root,i,r);return new jn(s,this.createQueryParams(t.queryParams,this.urlTree.queryParams),t.fragment)}createQueryParams(e,t){let i={};return Object.entries(e).forEach(([r,s])=>{if(typeof s=="string"&&s[0]===":"){let a=s.substring(1);i[r]=t[a]}else i[r]=s}),i}createSegmentGroup(e,t,i,r){let s=this.createSegments(e,t.segments,i,r),o={};return Object.entries(t.children).forEach(([a,l])=>{o[a]=this.createSegmentGroup(e,l,i,r)}),new we(s,o)}createSegments(e,t,i,r){return t.map(s=>s.path[0]===":"?this.findPosParam(e,s,r):this.findOrReturn(s,i))}findPosParam(e,t,i){let r=i[t.path.substring(1)];if(!r)throw new O(4001,!1);return r}findOrReturn(e,t){let i=0;for(let r of t){if(r.path===e.path)return t.splice(i),r;i++}return e}},mm={matched:!1,consumedSegments:[],remainingSegments:[],parameters:{},positionalParamSegments:{}};function _k(n,e,t,i,r){let s=pA(n,e,t);return s.matched?(i=z1(e,i),yk(i,e,t,r).pipe(z(o=>o===!0?s:x({},mm)))):U(s)}function pA(n,e,t){if(e.path==="**")return Ek(t);if(e.path==="")return e.pathMatch==="full"&&(n.hasChildren()||t.length>0)?x({},mm):{matched:!0,consumedSegments:[],remainingSegments:t,parameters:{},positionalParamSegments:{}};let r=(e.matcher||$C)(t,n,e);if(!r)return x({},mm);let s={};Object.entries(r.posParams??{}).forEach(([a,l])=>{s[a]=l.path});let o=r.consumed.length>0?x(x({},s),r.consumed[r.consumed.length-1].parameters):s;return{matched:!0,consumedSegments:r.consumed,remainingSegments:t.slice(r.consumed.length),parameters:o,positionalParamSegments:r.posParams??{}}}function Ek(n){return{matched:!0,parameters:n.length>0?WC(n).parameters:{},consumedSegments:n,remainingSegments:[],positionalParamSegments:{}}}function BC(n,e,t,i){return t.length>0&&Dk(n,t,i)?{segmentGroup:new we(e,Ak(i,new we(t,n.children))),slicedSegments:[]}:t.length===0&&Sk(n,t,i)?{segmentGroup:new we(n.segments,Ck(n,t,i,n.children)),slicedSegments:t}:{segmentGroup:new we(n.segments,n.children),slicedSegments:t}}function Ck(n,e,t,i){let r={};for(let s of t)if(qu(n,e,s)&&!i[En(s)]){let o=new we([],{});r[En(s)]=o}return x(x({},i),r)}function Ak(n,e){let t={};t[Q]=e;for(let i of n)if(i.path===""&&En(i)!==Q){let r=new we([],{});t[En(i)]=r}return t}function Dk(n,e,t){return t.some(i=>qu(n,e,i)&&En(i)!==Q)}function Sk(n,e,t){return t.some(i=>qu(n,e,i))}function qu(n,e,t){return(n.hasChildren()||e.length>0)&&t.pathMatch==="full"?!1:t.path===""}function xk(n,e,t){return e.length===0&&!n.children[t]}var vm=class{};function Ik(n,e,t,i,r,s,o="emptyOnly"){return new ym(n,e,t,i,r,o,s).recognize()}var Tk=31,ym=class{injector;configLoader;rootComponentType;config;urlTree;paramsInheritanceStrategy;urlSerializer;applyRedirects;absoluteRedirectCount=0;allowRedirects=!0;constructor(e,t,i,r,s,o,a){this.injector=e,this.configLoader=t,this.rootComponentType=i,this.config=r,this.urlTree=s,this.paramsInheritanceStrategy=o,this.urlSerializer=a,this.applyRedirects=new gm(this.urlSerializer,this.urlTree)}noMatchError(e){return new O(4002,`'${e.segmentGroup}'`)}recognize(){let e=BC(this.urlTree.root,[],[],this.config).segmentGroup;return this.match(e).pipe(z(({children:t,rootSnapshot:i})=>{let r=new Yt(i,t),s=new ya("",r),o=eA(i,[],this.urlTree.queryParams,this.urlTree.fragment);return o.queryParams=this.urlTree.queryParams,s.url=this.urlSerializer.serialize(o),{state:s,tree:o}}))}match(e){let t=new xr([],Object.freeze({}),Object.freeze(x({},this.urlTree.queryParams)),this.urlTree.fragment,Object.freeze({}),Q,this.rootComponentType,null,{});return this.processSegmentGroup(this.injector,this.config,e,Q,t).pipe(z(i=>({children:i,rootSnapshot:t})),st(i=>{if(i instanceof _a)return this.urlTree=i.urlTree,this.match(i.urlTree.root);throw i instanceof wa?this.noMatchError(i):i}))}processSegmentGroup(e,t,i,r,s){return i.segments.length===0&&i.hasChildren()?this.processChildren(e,t,i,s):this.processSegment(e,t,i,i.segments,r,!0,s).pipe(z(o=>o instanceof Yt?[o]:[]))}processChildren(e,t,i,r){let s=[];for(let o of Object.keys(i.children))o==="primary"?s.unshift(o):s.push(o);return Ae(s).pipe(xn(o=>{let a=i.children[o],l=W1(t,o);return this.processSegmentGroup(e,l,a,o,r)}),Ef((o,a)=>(o.push(...a),o)),Ii(null),_f(),He(o=>{if(o===null)return ks(i);let a=gA(o);return Mk(a),U(a)}))}processSegment(e,t,i,r,s,o,a){return Ae(t).pipe(xn(l=>this.processSegmentAgainstRoute(l._injector??e,t,l,i,r,s,o,a).pipe(st(c=>{if(c instanceof wa)return U(null);throw c}))),Zn(l=>!!l),st(l=>{if(hA(l))return xk(i,r,s)?U(new vm):ks(i);throw l}))}processSegmentAgainstRoute(e,t,i,r,s,o,a,l){return En(i)!==o&&(o===Q||!qu(r,s,i))?ks(r):i.redirectTo===void 0?this.matchSegmentAgainstRoute(e,r,i,s,o,l):this.allowRedirects&&a?this.expandSegmentAgainstRouteUsingRedirect(e,r,t,i,s,o,l):ks(r)}expandSegmentAgainstRouteUsingRedirect(e,t,i,r,s,o,a){let{matched:l,parameters:c,consumedSegments:u,positionalParamSegments:d,remainingSegments:h}=pA(t,r,s);if(!l)return ks(t);typeof r.redirectTo=="string"&&r.redirectTo[0]==="/"&&(this.absoluteRedirectCount++,this.absoluteRedirectCount>Tk&&(this.allowRedirects=!1));let f=new xr(s,c,Object.freeze(x({},this.urlTree.queryParams)),this.urlTree.fragment,UC(r),En(r),r.component??r._loadedComponent??null,r,HC(r)),p=Hu(f,a,this.paramsInheritanceStrategy);f.params=Object.freeze(p.params),f.data=Object.freeze(p.data);let g=this.applyRedirects.applyRedirectCommands(u,r.redirectTo,d,f,e);return this.applyRedirects.lineralizeSegments(r,g).pipe(He(v=>this.processSegment(e,i,t,v.concat(h),o,!1,a)))}matchSegmentAgainstRoute(e,t,i,r,s,o){let a=_k(t,i,r,e,this.urlSerializer);return i.path==="**"&&(t.children={}),a.pipe(gt(l=>l.matched?(e=i._injector??e,this.getChildConfig(e,i,r).pipe(gt(({routes:c})=>{let u=i._loadedInjector??e,{parameters:d,consumedSegments:h,remainingSegments:f}=l,p=new xr(h,d,Object.freeze(x({},this.urlTree.queryParams)),this.urlTree.fragment,UC(i),En(i),i.component??i._loadedComponent??null,i,HC(i)),g=Hu(p,o,this.paramsInheritanceStrategy);p.params=Object.freeze(g.params),p.data=Object.freeze(g.data);let{segmentGroup:v,slicedSegments:m}=BC(t,h,f,c);if(m.length===0&&v.hasChildren())return this.processChildren(u,c,v,p).pipe(z(b=>new Yt(p,b)));if(c.length===0&&m.length===0)return U(new Yt(p,[]));let y=En(i)===s;return this.processSegment(u,c,v,m,y?Q:s,!0,p).pipe(z(b=>new Yt(p,b instanceof Yt?[b]:[])))}))):ks(t)))}getChildConfig(e,t,i){return t.children?U({routes:t.children,injector:e}):t.loadChildren?t._loadedRoutes!==void 0?U({routes:t._loadedRoutes,injector:t._loadedInjector}):vk(e,t,i,this.urlSerializer).pipe(He(r=>r?this.configLoader.loadChildren(e,t).pipe(Xe(s=>{t._loadedRoutes=s.routes,t._loadedInjector=s.injector})):wk(t))):U({routes:[],injector:e})}};function Mk(n){n.sort((e,t)=>e.value.outlet===Q?-1:t.value.outlet===Q?1:e.value.outlet.localeCompare(t.value.outlet))}function Rk(n){let e=n.value.routeConfig;return e&&e.path===""}function gA(n){let e=[],t=new Set;for(let i of n){if(!Rk(i)){e.push(i);continue}let r=e.find(s=>i.value.routeConfig===s.value.routeConfig);r!==void 0?(r.children.push(...i.children),t.add(r)):e.push(i)}for(let i of t){let r=gA(i.children);e.push(new Yt(i.value,r))}return e.filter(i=>!t.has(i))}function UC(n){return n.data||{}}function HC(n){return n.resolve||{}}function Pk(n,e,t,i,r,s){return He(o=>Ik(n,e,t,i,o.extractedUrl,r,s).pipe(z(({state:a,tree:l})=>G(x({},o),{targetSnapshot:a,urlAfterRedirects:l}))))}function Nk(n,e){return He(t=>{let{targetSnapshot:i,guards:{canActivateChecks:r}}=t;if(!r.length)return U(t);let s=new Set(r.map(l=>l.route)),o=new Set;for(let l of s)if(!o.has(l))for(let c of mA(l))o.add(c);let a=0;return Ae(o).pipe(xn(l=>s.has(l)?kk(l,i,n,e):(l.data=Hu(l,l.parent,n).resolve,U(void 0))),Xe(()=>a++),ts(1),He(l=>a===o.size?U(t):Tt))})}function mA(n){let e=n.children.map(t=>mA(t)).flat();return[n,...e]}function kk(n,e,t,i){let r=n.routeConfig,s=n._resolve;return r?.title!==void 0&&!aA(r)&&(s[Ea]=r.title),Ok(s,n,e,i).pipe(z(o=>(n._resolvedData=o,n.data=Hu(n,n.parent,t).resolve,null)))}function Ok(n,e,t,i){let r=om(n);if(r.length===0)return U({});let s={};return Ae(r).pipe(He(o=>Lk(n[o],e,t,i).pipe(Zn(),Xe(a=>{if(a instanceof Us)throw $u(new Tr,a);s[o]=a}))),ts(1),z(()=>s),st(o=>hA(o)?Tt:xi(o)))}function Lk(n,e,t,i){let r=Aa(e)??i,s=zs(n,r),o=s.resolve?s.resolve(e,t):zt(r,()=>s(e,t));return ji(o)}function rm(n){return gt(e=>{let t=n(e);return t?Ae(t).pipe(z(()=>e)):U(e)})}var Em=(()=>{class n{buildTitle(t){let i,r=t.root;for(;r!==void 0;)i=this.getResolvedTitleForRoute(r)??i,r=r.children.find(s=>s.outlet===Q);return i}getResolvedTitleForRoute(t){return t.data[Ea]}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:()=>T(vA),providedIn:"root"})}return n})(),vA=(()=>{class n extends Em{title;constructor(t){super(),this.title=t}updateTitle(t){let i=this.buildTitle(t);i!==void 0&&this.title.setTitle(i)}static \u0275fac=function(i){return new(i||n)(F(_u))};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),xa=new L("",{providedIn:"root",factory:()=>({})}),Ia=new L(""),yA=(()=>{class n{componentLoaders=new WeakMap;childrenLoaders=new WeakMap;onLoadStartListener;onLoadEndListener;compiler=T(FE);loadComponent(t){if(this.componentLoaders.get(t))return this.componentLoaders.get(t);if(t._loadedComponent)return U(t._loadedComponent);this.onLoadStartListener&&this.onLoadStartListener(t);let i=ji(t.loadComponent()).pipe(z(wA),Xe(s=>{this.onLoadEndListener&&this.onLoadEndListener(t),t._loadedComponent=s}),tr(()=>{this.componentLoaders.delete(t)})),r=new Zr(i,()=>new Se).pipe(Kr());return this.componentLoaders.set(t,r),r}loadChildren(t,i){if(this.childrenLoaders.get(i))return this.childrenLoaders.get(i);if(i._loadedRoutes)return U({routes:i._loadedRoutes,injector:i._loadedInjector});this.onLoadStartListener&&this.onLoadStartListener(i);let s=bA(i,this.compiler,t,this.onLoadEndListener).pipe(tr(()=>{this.childrenLoaders.delete(i)})),o=new Zr(s,()=>new Se).pipe(Kr());return this.childrenLoaders.set(i,o),o}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function bA(n,e,t,i){return ji(n.loadChildren()).pipe(z(wA),He(r=>r instanceof Tg||Array.isArray(r)?U(r):Ae(e.compileModuleAsync(r))),z(r=>{i&&i(n);let s,o,a=!1;return Array.isArray(r)?(o=r,a=!0):(s=r.create(t).injector,o=s.get(Ia,[],{optional:!0,self:!0}).flat()),{routes:o.map(_m),injector:s}}))}function Fk(n){return n&&typeof n=="object"&&"default"in n}function wA(n){return Fk(n)?n.default:n}var Yu=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:()=>T(Vk),providedIn:"root"})}return n})(),Vk=(()=>{class n{shouldProcessUrl(t){return!0}extract(t){return t}merge(t,i){return t}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),_A=new L("");var EA=new L(""),CA=(()=>{class n{currentNavigation=null;currentTransition=null;lastSuccessfulNavigation=null;events=new Se;transitionAbortSubject=new Se;configLoader=T(yA);environmentInjector=T(kt);destroyRef=T(yr);urlSerializer=T(Ca);rootContexts=T($s);location=T(Is);inputBindingEnabled=T(Gu,{optional:!0})!==null;titleStrategy=T(Em);options=T(xa,{optional:!0})||{};paramsInheritanceStrategy=this.options.paramsInheritanceStrategy||"emptyOnly";urlHandlingStrategy=T(Yu);createViewTransition=T(_A,{optional:!0});navigationErrorHandler=T(EA,{optional:!0});navigationId=0;get hasRequestedNavigation(){return this.navigationId!==0}transitions;afterPreactivation=()=>U(void 0);rootComponentType=null;destroyed=!1;constructor(){let t=r=>this.events.next(new ku(r)),i=r=>this.events.next(new Ou(r));this.configLoader.onLoadEndListener=i,this.configLoader.onLoadStartListener=t,this.destroyRef.onDestroy(()=>{this.destroyed=!0})}complete(){this.transitions?.complete()}handleNavigationRequest(t){let i=++this.navigationId;this.transitions?.next(G(x({},t),{extractedUrl:this.urlHandlingStrategy.extract(t.rawUrl),targetSnapshot:null,targetRouterState:null,guards:{canActivateChecks:[],canDeactivateChecks:[]},guardsResult:null,id:i}))}setupNavigations(t){return this.transitions=new et(null),this.transitions.pipe(At(i=>i!==null),gt(i=>{let r=!1,s=!1;return U(i).pipe(gt(o=>{if(this.navigationId>i.id)return this.cancelNavigationTransition(i,"",Vt.SupersededByNewNavigation),Tt;this.currentTransition=i,this.currentNavigation={id:o.id,initialUrl:o.rawUrl,extractedUrl:o.extractedUrl,targetBrowserUrl:typeof o.extras.browserUrl=="string"?this.urlSerializer.parse(o.extras.browserUrl):o.extras.browserUrl,trigger:o.source,extras:o.extras,previousNavigation:this.lastSuccessfulNavigation?G(x({},this.lastSuccessfulNavigation),{previousNavigation:null}):null};let a=!t.navigated||this.isUpdatingInternalState()||this.isUpdatedBrowserUrl(),l=o.extras.onSameUrlNavigation??t.onSameUrlNavigation;if(!a&&l!=="reload"){let c="";return this.events.next(new fi(o.id,this.urlSerializer.serialize(o.rawUrl),c,pa.IgnoredSameUrlNavigation)),o.resolve(!1),Tt}if(this.urlHandlingStrategy.shouldProcessUrl(o.rawUrl))return U(o).pipe(gt(c=>(this.events.next(new Mr(c.id,this.urlSerializer.serialize(c.extractedUrl),c.source,c.restoredState)),c.id!==this.navigationId?Tt:Promise.resolve(c))),Pk(this.environmentInjector,this.configLoader,this.rootComponentType,t.config,this.urlSerializer,this.paramsInheritanceStrategy),Xe(c=>{i.targetSnapshot=c.targetSnapshot,i.urlAfterRedirects=c.urlAfterRedirects,this.currentNavigation=G(x({},this.currentNavigation),{finalUrl:c.urlAfterRedirects});let u=new ga(c.id,this.urlSerializer.serialize(c.extractedUrl),this.urlSerializer.serialize(c.urlAfterRedirects),c.targetSnapshot);this.events.next(u)}));if(a&&this.urlHandlingStrategy.shouldProcessUrl(o.currentRawUrl)){let{id:c,extractedUrl:u,source:d,restoredState:h,extras:f}=o,p=new Mr(c,this.urlSerializer.serialize(u),d,h);this.events.next(p);let g=sA(this.rootComponentType).snapshot;return this.currentTransition=i=G(x({},o),{targetSnapshot:g,urlAfterRedirects:u,extras:G(x({},f),{skipLocationChange:!1,replaceUrl:!1})}),this.currentNavigation.finalUrl=u,U(i)}else{let c="";return this.events.next(new fi(o.id,this.urlSerializer.serialize(o.extractedUrl),c,pa.IgnoredByUrlHandlingStrategy)),o.resolve(!1),Tt}}),Xe(o=>{let a=new Mu(o.id,this.urlSerializer.serialize(o.extractedUrl),this.urlSerializer.serialize(o.urlAfterRedirects),o.targetSnapshot);this.events.next(a)}),z(o=>(this.currentTransition=i=G(x({},o),{guards:Q1(o.targetSnapshot,o.currentSnapshot,this.rootContexts)}),i)),ck(this.environmentInjector,o=>this.events.next(o)),Xe(o=>{if(i.guardsResult=o.guardsResult,o.guardsResult&&typeof o.guardsResult!="boolean")throw $u(this.urlSerializer,o.guardsResult);let a=new Ru(o.id,this.urlSerializer.serialize(o.extractedUrl),this.urlSerializer.serialize(o.urlAfterRedirects),o.targetSnapshot,!!o.guardsResult);this.events.next(a)}),At(o=>o.guardsResult?!0:(this.cancelNavigationTransition(o,"",Vt.GuardRejected),!1)),rm(o=>{if(o.guards.canActivateChecks.length!==0)return U(o).pipe(Xe(a=>{let l=new Pu(a.id,this.urlSerializer.serialize(a.extractedUrl),this.urlSerializer.serialize(a.urlAfterRedirects),a.targetSnapshot);this.events.next(l)}),gt(a=>{let l=!1;return U(a).pipe(Nk(this.paramsInheritanceStrategy,this.environmentInjector),Xe({next:()=>l=!0,complete:()=>{l||this.cancelNavigationTransition(a,"",Vt.NoDataFromResolver)}}))}),Xe(a=>{let l=new Nu(a.id,this.urlSerializer.serialize(a.extractedUrl),this.urlSerializer.serialize(a.urlAfterRedirects),a.targetSnapshot);this.events.next(l)}))}),rm(o=>{let a=l=>{let c=[];l.routeConfig?.loadComponent&&!l.routeConfig._loadedComponent&&c.push(this.configLoader.loadComponent(l.routeConfig).pipe(Xe(u=>{l.component=u}),z(()=>{})));for(let u of l.children)c.push(...a(u));return c};return Yl(a(o.targetSnapshot.root)).pipe(Ii(null),Rt(1))}),rm(()=>this.afterPreactivation()),gt(()=>{let{currentSnapshot:o,targetSnapshot:a}=i,l=this.createViewTransition?.(this.environmentInjector,o.root,a.root);return l?Ae(l).pipe(z(()=>i)):U(i)}),z(o=>{let a=q1(t.routeReuseStrategy,o.targetSnapshot,o.currentRouterState);return this.currentTransition=i=G(x({},o),{targetRouterState:a}),this.currentNavigation.targetRouterState=a,i}),Xe(()=>{this.events.next(new ma)}),Z1(this.rootContexts,t.routeReuseStrategy,o=>this.events.next(o),this.inputBindingEnabled),Rt(1),Xe({next:o=>{r=!0,this.lastSuccessfulNavigation=this.currentNavigation,this.events.next(new hi(o.id,this.urlSerializer.serialize(o.extractedUrl),this.urlSerializer.serialize(o.urlAfterRedirects))),this.titleStrategy?.updateTitle(o.targetRouterState.snapshot),o.resolve(!0)},complete:()=>{r=!0}}),xe(this.transitionAbortSubject.pipe(Xe(o=>{throw o}))),tr(()=>{!r&&!s&&this.cancelNavigationTransition(i,"",Vt.SupersededByNewNavigation),this.currentTransition?.id===i.id&&(this.currentNavigation=null,this.currentTransition=null)}),st(o=>{if(this.destroyed)return i.resolve(!1),Tt;if(s=!0,dA(o))this.events.next(new Vn(i.id,this.urlSerializer.serialize(i.extractedUrl),o.message,o.cancellationCode)),K1(o)?this.events.next(new Bs(o.url,o.navigationBehaviorOptions)):i.resolve(!1);else{let a=new js(i.id,this.urlSerializer.serialize(i.extractedUrl),o,i.targetSnapshot??void 0);try{let l=zt(this.environmentInjector,()=>this.navigationErrorHandler?.(a));if(l instanceof Us){let{message:c,cancellationCode:u}=$u(this.urlSerializer,l);this.events.next(new Vn(i.id,this.urlSerializer.serialize(i.extractedUrl),c,u)),this.events.next(new Bs(l.redirectTo,l.navigationBehaviorOptions))}else throw this.events.next(a),o}catch(l){this.options.resolveNavigationPromiseOnError?i.resolve(!1):i.reject(l)}}return Tt}))}))}cancelNavigationTransition(t,i,r){let s=new Vn(t.id,this.urlSerializer.serialize(t.extractedUrl),i,r);this.events.next(s),t.resolve(!1)}isUpdatingInternalState(){return this.currentTransition?.extractedUrl.toString()!==this.currentTransition?.currentUrlTree.toString()}isUpdatedBrowserUrl(){let t=this.urlHandlingStrategy.extract(this.urlSerializer.parse(this.location.path(!0))),i=this.currentNavigation?.targetBrowserUrl??this.currentNavigation?.extractedUrl;return t.toString()!==i?.toString()&&!this.currentNavigation?.extras.skipLocationChange}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function jk(n){return n!==xu}var AA=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:()=>T(Bk),providedIn:"root"})}return n})(),Wu=class{shouldDetach(e){return!1}store(e,t){}shouldAttach(e){return!1}retrieve(e){return null}shouldReuseRoute(e,t){return e.routeConfig===t.routeConfig}},Bk=(()=>{class n extends Wu{static \u0275fac=(()=>{let t;return function(r){return(t||(t=mn(n)))(r||n)}})();static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})(),DA=(()=>{class n{urlSerializer=T(Ca);options=T(xa,{optional:!0})||{};canceledNavigationResolution=this.options.canceledNavigationResolution||"replace";location=T(Is);urlHandlingStrategy=T(Yu);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";currentUrlTree=new jn;getCurrentUrlTree(){return this.currentUrlTree}rawUrlTree=this.currentUrlTree;getRawUrlTree(){return this.rawUrlTree}createBrowserPath({finalUrl:t,initialUrl:i,targetBrowserUrl:r}){let s=t!==void 0?this.urlHandlingStrategy.merge(t,i):i,o=r??s;return o instanceof jn?this.urlSerializer.serialize(o):o}commitTransition({targetRouterState:t,finalUrl:i,initialUrl:r}){i&&t?(this.currentUrlTree=i,this.rawUrlTree=this.urlHandlingStrategy.merge(i,r),this.routerState=t):this.rawUrlTree=r}routerState=sA(null);getRouterState(){return this.routerState}stateMemento=this.createStateMemento();updateStateMemento(){this.stateMemento=this.createStateMemento()}createStateMemento(){return{rawUrlTree:this.rawUrlTree,currentUrlTree:this.currentUrlTree,routerState:this.routerState}}resetInternalState({finalUrl:t}){this.routerState=this.stateMemento.routerState,this.currentUrlTree=this.stateMemento.currentUrlTree,this.rawUrlTree=this.urlHandlingStrategy.merge(this.currentUrlTree,t??this.rawUrlTree)}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:()=>T(Uk),providedIn:"root"})}return n})(),Uk=(()=>{class n extends DA{currentPageId=0;lastSuccessfulId=-1;restoredState(){return this.location.getState()}get browserPageId(){return this.canceledNavigationResolution!=="computed"?this.currentPageId:this.restoredState()?.\u0275routerPageId??this.currentPageId}registerNonRouterCurrentEntryChangeListener(t){return this.location.subscribe(i=>{i.type==="popstate"&&setTimeout(()=>{t(i.url,i.state,"popstate")})})}handleRouterEvent(t,i){t instanceof Mr?this.updateStateMemento():t instanceof fi?this.commitTransition(i):t instanceof ga?this.urlUpdateStrategy==="eager"&&(i.extras.skipLocationChange||this.setBrowserUrl(this.createBrowserPath(i),i)):t instanceof ma?(this.commitTransition(i),this.urlUpdateStrategy==="deferred"&&!i.extras.skipLocationChange&&this.setBrowserUrl(this.createBrowserPath(i),i)):t instanceof Vn&&(t.code===Vt.GuardRejected||t.code===Vt.NoDataFromResolver)?this.restoreHistory(i):t instanceof js?this.restoreHistory(i,!0):t instanceof hi&&(this.lastSuccessfulId=t.id,this.currentPageId=this.browserPageId)}setBrowserUrl(t,{extras:i,id:r}){let{replaceUrl:s,state:o}=i;if(this.location.isCurrentPathEqualTo(t)||s){let a=this.browserPageId,l=x(x({},o),this.generateNgRouterState(r,a));this.location.replaceState(t,"",l)}else{let a=x(x({},o),this.generateNgRouterState(r,this.browserPageId+1));this.location.go(t,"",a)}}restoreHistory(t,i=!1){if(this.canceledNavigationResolution==="computed"){let r=this.browserPageId,s=this.currentPageId-r;s!==0?this.location.historyGo(s):this.getCurrentUrlTree()===t.finalUrl&&s===0&&(this.resetInternalState(t),this.resetUrlToCurrentUrlTree())}else this.canceledNavigationResolution==="replace"&&(i&&this.resetInternalState(t),this.resetUrlToCurrentUrlTree())}resetUrlToCurrentUrlTree(){this.location.replaceState(this.urlSerializer.serialize(this.getRawUrlTree()),"",this.generateNgRouterState(this.lastSuccessfulId,this.currentPageId))}generateNgRouterState(t,i){return this.canceledNavigationResolution==="computed"?{navigationId:t,\u0275routerPageId:i}:{navigationId:t}}static \u0275fac=(()=>{let t;return function(r){return(t||(t=mn(n)))(r||n)}})();static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function Cm(n,e){n.events.pipe(At(t=>t instanceof hi||t instanceof Vn||t instanceof js||t instanceof fi),z(t=>t instanceof hi||t instanceof fi?0:(t instanceof Vn?t.code===Vt.Redirect||t.code===Vt.SupersededByNewNavigation:!1)?2:1),At(t=>t!==2),Rt(1)).subscribe(()=>{e()})}var Hk={paths:"exact",fragment:"ignored",matrixParams:"ignored",queryParams:"exact"},$k={paths:"subset",fragment:"ignored",matrixParams:"ignored",queryParams:"subset"},Ws=(()=>{class n{get currentUrlTree(){return this.stateManager.getCurrentUrlTree()}get rawUrlTree(){return this.stateManager.getRawUrlTree()}disposed=!1;nonRouterCurrentEntryChangeSubscription;console=T(EE);stateManager=T(DA);options=T(xa,{optional:!0})||{};pendingTasks=T(Ri);urlUpdateStrategy=this.options.urlUpdateStrategy||"deferred";navigationTransitions=T(CA);urlSerializer=T(Ca);location=T(Is);urlHandlingStrategy=T(Yu);_events=new Se;get events(){return this._events}get routerState(){return this.stateManager.getRouterState()}navigated=!1;routeReuseStrategy=T(AA);onSameUrlNavigation=this.options.onSameUrlNavigation||"ignore";config=T(Ia,{optional:!0})?.flat()??[];componentInputBindingEnabled=!!T(Gu,{optional:!0});constructor(){this.resetConfig(this.config),this.navigationTransitions.setupNavigations(this).subscribe({error:t=>{this.console.warn(t)}}),this.subscribeToNavigationEvents()}eventsSubscription=new je;subscribeToNavigationEvents(){let t=this.navigationTransitions.events.subscribe(i=>{try{let r=this.navigationTransitions.currentTransition,s=this.navigationTransitions.currentNavigation;if(r!==null&&s!==null){if(this.stateManager.handleRouterEvent(i,s),i instanceof Vn&&i.code!==Vt.Redirect&&i.code!==Vt.SupersededByNewNavigation)this.navigated=!0;else if(i instanceof hi)this.navigated=!0;else if(i instanceof Bs){let o=i.navigationBehaviorOptions,a=this.urlHandlingStrategy.merge(i.url,r.currentRawUrl),l=x({browserUrl:r.extras.browserUrl,info:r.extras.info,skipLocationChange:r.extras.skipLocationChange,replaceUrl:r.extras.replaceUrl||this.urlUpdateStrategy==="eager"||jk(r.source)},o);this.scheduleNavigation(a,xu,null,l,{resolve:r.resolve,reject:r.reject,promise:r.promise})}}Wk(i)&&this._events.next(i)}catch(r){this.navigationTransitions.transitionAbortSubject.next(r)}});this.eventsSubscription.add(t)}resetRootComponentType(t){this.routerState.root.component=t,this.navigationTransitions.rootComponentType=t}initialNavigation(){this.setUpLocationChangeListener(),this.navigationTransitions.hasRequestedNavigation||this.navigateToSyncWithBrowser(this.location.path(!0),xu,this.stateManager.restoredState())}setUpLocationChangeListener(){this.nonRouterCurrentEntryChangeSubscription??=this.stateManager.registerNonRouterCurrentEntryChangeListener((t,i,r)=>{this.navigateToSyncWithBrowser(t,r,i)})}navigateToSyncWithBrowser(t,i,r){let s={replaceUrl:!0},o=r?.navigationId?r:null;if(r){let l=x({},r);delete l.navigationId,delete l.\u0275routerPageId,Object.keys(l).length!==0&&(s.state=l)}let a=this.parseUrl(t);this.scheduleNavigation(a,i,o,s)}get url(){return this.serializeUrl(this.currentUrlTree)}getCurrentNavigation(){return this.navigationTransitions.currentNavigation}get lastSuccessfulNavigation(){return this.navigationTransitions.lastSuccessfulNavigation}resetConfig(t){this.config=t.map(_m),this.navigated=!1}ngOnDestroy(){this.dispose()}dispose(){this._events.unsubscribe(),this.navigationTransitions.complete(),this.nonRouterCurrentEntryChangeSubscription&&(this.nonRouterCurrentEntryChangeSubscription.unsubscribe(),this.nonRouterCurrentEntryChangeSubscription=void 0),this.disposed=!0,this.eventsSubscription.unsubscribe()}createUrlTree(t,i={}){let{relativeTo:r,queryParams:s,fragment:o,queryParamsHandling:a,preserveFragment:l}=i,c=l?this.currentUrlTree.fragment:o,u=null;switch(a??this.options.defaultQueryParamsHandling){case"merge":u=x(x({},this.currentUrlTree.queryParams),s);break;case"preserve":u=this.currentUrlTree.queryParams;break;default:u=s||null}u!==null&&(u=this.removeEmptyProps(u));let d;try{let h=r?r.snapshot:this.routerState.snapshot.root;d=tA(h)}catch{(typeof t[0]!="string"||t[0][0]!=="/")&&(t=[]),d=this.currentUrlTree.root}return nA(d,t,u,c??null)}navigateByUrl(t,i={skipLocationChange:!1}){let r=Vs(t)?t:this.parseUrl(t),s=this.urlHandlingStrategy.merge(r,this.rawUrlTree);return this.scheduleNavigation(s,xu,null,i)}navigate(t,i={skipLocationChange:!1}){return zk(t),this.navigateByUrl(this.createUrlTree(t,i),i)}serializeUrl(t){return this.urlSerializer.serialize(t)}parseUrl(t){try{return this.urlSerializer.parse(t)}catch{return this.urlSerializer.parse("/")}}isActive(t,i){let r;if(i===!0?r=x({},Hk):i===!1?r=x({},$k):r=i,Vs(t))return LC(this.currentUrlTree,t,r);let s=this.parseUrl(t);return LC(this.currentUrlTree,s,r)}removeEmptyProps(t){return Object.entries(t).reduce((i,[r,s])=>(s!=null&&(i[r]=s),i),{})}scheduleNavigation(t,i,r,s,o){if(this.disposed)return Promise.resolve(!1);let a,l,c;o?(a=o.resolve,l=o.reject,c=o.promise):c=new Promise((d,h)=>{a=d,l=h});let u=this.pendingTasks.add();return Cm(this,()=>{queueMicrotask(()=>this.pendingTasks.remove(u))}),this.navigationTransitions.handleNavigationRequest({source:i,restoredState:r,currentUrlTree:this.currentUrlTree,currentRawUrl:this.currentUrlTree,rawUrl:t,extras:s,resolve:a,reject:l,promise:c,currentSnapshot:this.routerState.snapshot,currentRouterState:this.routerState}),c.catch(d=>Promise.reject(d))}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();function zk(n){for(let e=0;et.\u0275providers)])}function Yk(n){return n.routerState.root}function Xk(){let n=T(Pn);return e=>{let t=n.get(pr);if(e!==t.components[0])return;let i=n.get(Ws),r=n.get(Kk);n.get(Zk)===1&&i.initialNavigation(),n.get(Qk,null,J.Optional)?.setUpPreloading(),n.get(qk,null,J.Optional)?.init(),i.resetRootComponentType(t.componentTypes[0]),r.closed||(r.next(),r.complete(),r.unsubscribe())}}var Kk=new L("",{factory:()=>new Se}),Zk=new L("",{providedIn:"root",factory:()=>1});var Qk=new L("");var pi=class{},Dm=(()=>{class n extends pi{getTranslation(t){return U({})}static \u0275fac=(()=>{let t;return function(r){return(t||(t=mn(n)))(r||n)}})();static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})(),Gs=class{},Sm=(()=>{class n{handle(t){return t.key}static \u0275fac=function(i){return new(i||n)};static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})();function Ku(n,e){if(n===e)return!0;if(n===null||e===null)return!1;if(n!==n&&e!==e)return!0;let t=typeof n,i=typeof e,r,s,o;if(t==i&&t=="object")if(Array.isArray(n)){if(!Array.isArray(e))return!1;if((r=n.length)==e.length){for(s=0;s{Ma(e[i])?i in n?t[i]=xm(n[i],e[i]):Object.assign(t,{[i]:e[i]}):Object.assign(t,{[i]:e[i]})}),t):xm({},e)}function Im(n,e){let t=e.split(".");e="";do e+=t.shift(),Bi(n)&&Bi(n[e])&&(Ma(n[e])||Rm(n[e])||!t.length)?(n=n[e],e=""):t.length?e+=".":n=void 0;while(t.length);return n}function nO(n,e,t){let i=e.split("."),r=n;for(let s=0;s{class n extends Rr{templateMatcher=/{{\s?([^{}\s]*)\s?}}/g;interpolate(t,i){if(Pm(t))return this.interpolateString(t,i);if(tO(t))return this.interpolateFunction(t,i)}interpolateFunction(t,i){return t(i)}interpolateString(t,i){return i?t.replace(this.templateMatcher,(r,s)=>{let o=Im(i,s);return Bi(o)?o:r}):t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=mn(n)))(r||n)}})();static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})(),Pr=class{},Mm=(()=>{class n extends Pr{compile(t,i){return t}compileTranslations(t,i){return t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=mn(n)))(r||n)}})();static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})(),qs=class{defaultLang;currentLang=this.defaultLang;translations={};langs=[];onTranslationChange=new oe;onLangChange=new oe;onDefaultLangChange=new oe},Zu=new L("ISOLATE_TRANSLATE_SERVICE"),Qu=new L("USE_DEFAULT_LANG"),Ju=new L("DEFAULT_LANGUAGE"),ed=new L("USE_EXTEND"),Ta=n=>Yn(n)?n:U(n),Bn=(()=>{class n{store;currentLoader;compiler;parser;missingTranslationHandler;useDefaultLang;extend;loadingTranslations;pending=!1;_translationRequests={};lastUseLanguage=null;get onTranslationChange(){return this.store.onTranslationChange}get onLangChange(){return this.store.onLangChange}get onDefaultLangChange(){return this.store.onDefaultLangChange}get defaultLang(){return this.store.defaultLang}set defaultLang(t){this.store.defaultLang=t}get currentLang(){return this.store.currentLang}set currentLang(t){this.store.currentLang=t}get langs(){return this.store.langs}set langs(t){this.store.langs=t}get translations(){return this.store.translations}set translations(t){this.store.translations=t}constructor(t,i,r,s,o,a=!0,l=!1,c=!1,u){this.store=t,this.currentLoader=i,this.compiler=r,this.parser=s,this.missingTranslationHandler=o,this.useDefaultLang=a,this.extend=c,l&&(this.store=new qs),u&&this.setDefaultLang(u)}setDefaultLang(t){if(t===this.defaultLang)return;let i=this.retrieveTranslations(t);typeof i<"u"?(this.defaultLang==null&&(this.defaultLang=t),i.pipe(Rt(1)).subscribe(()=>{this.changeDefaultLang(t)})):this.changeDefaultLang(t)}getDefaultLang(){return this.defaultLang}use(t){if(this.lastUseLanguage=t,t===this.currentLang)return U(this.translations[t]);this.currentLang||(this.currentLang=t);let i=this.retrieveTranslations(t);return Yn(i)?(i.pipe(Rt(1)).subscribe(()=>{this.changeLang(t)}),i):(this.changeLang(t),U(this.translations[t]))}changeLang(t){t===this.lastUseLanguage&&(this.currentLang=t,this.onLangChange.emit({lang:t,translations:this.translations[t]}),this.defaultLang==null&&this.changeDefaultLang(t))}retrieveTranslations(t){if(typeof this.translations[t]>"u"||this.extend)return this._translationRequests[t]=this._translationRequests[t]||this.loadAndCompileTranslations(t),this._translationRequests[t]}getTranslation(t){return this.loadAndCompileTranslations(t)}loadAndCompileTranslations(t){this.pending=!0;let i=this.currentLoader.getTranslation(t).pipe(Kl(1),Rt(1));return this.loadingTranslations=i.pipe(z(r=>this.compiler.compileTranslations(r,t)),Kl(1),Rt(1)),this.loadingTranslations.subscribe({next:r=>{this.translations[t]=this.extend&&this.translations[t]?x(x({},r),this.translations[t]):r,this.updateLangs(),this.pending=!1},error:r=>{this.pending=!1}}),i}setTranslation(t,i,r=!1){let s=this.compiler.compileTranslations(i,t);(r||this.extend)&&this.translations[t]?this.translations[t]=xm(this.translations[t],s):this.translations[t]=s,this.updateLangs(),this.onTranslationChange.emit({lang:t,translations:this.translations[t]})}getLangs(){return this.langs}addLangs(t){let i=t.filter(r=>!this.langs.includes(r));i.length>0&&(this.langs=[...this.langs,...i])}updateLangs(){this.addLangs(Object.keys(this.translations))}getParsedResultForKey(t,i,r){let s;if(t&&(s=this.runInterpolation(Im(t,i),r)),s===void 0&&this.defaultLang!=null&&this.defaultLang!==this.currentLang&&this.useDefaultLang&&(s=this.runInterpolation(Im(this.translations[this.defaultLang],i),r)),s===void 0){let o={key:i,translateService:this};typeof r<"u"&&(o.interpolateParams=r),s=this.missingTranslationHandler.handle(o)}return s!==void 0?s:i}runInterpolation(t,i){if(Rm(t))return t.map(r=>this.runInterpolation(r,i));if(Ma(t)){let r={};for(let s in t){let o=this.runInterpolation(t[s],i);o!==void 0&&(r[s]=o)}return r}else return this.parser.interpolate(t,i)}getParsedResult(t,i,r){if(i instanceof Array){let s={},o=!1;for(let l of i)s[l]=this.getParsedResultForKey(t,l,r),o=o||Yn(s[l]);if(!o)return s;let a=i.map(l=>Ta(s[l]));return wo(a).pipe(z(l=>{let c={};return l.forEach((u,d)=>{c[i[d]]=u}),c}))}return this.getParsedResultForKey(t,i,r)}get(t,i){if(!Bi(t)||!t.length)throw new Error('Parameter "key" is required and cannot be empty');return this.pending?this.loadingTranslations.pipe(xn(r=>Ta(this.getParsedResult(r,t,i)))):Ta(this.getParsedResult(this.translations[this.currentLang],t,i))}getStreamOnTranslationChange(t,i){if(!Bi(t)||!t.length)throw new Error('Parameter "key" is required and cannot be empty');return Kn(er(()=>this.get(t,i)),this.onTranslationChange.pipe(gt(r=>{let s=this.getParsedResult(r.translations,t,i);return Ta(s)})))}stream(t,i){if(!Bi(t)||!t.length)throw new Error('Parameter "key" required');return Kn(er(()=>this.get(t,i)),this.onLangChange.pipe(gt(r=>{let s=this.getParsedResult(r.translations,t,i);return Ta(s)})))}instant(t,i){if(!Bi(t)||t.length===0)throw new Error('Parameter "key" is required and cannot be empty');let r=this.getParsedResult(this.translations[this.currentLang],t,i);return Yn(r)?Array.isArray(t)?t.reduce((s,o)=>(s[o]=o,s),{}):t:r}set(t,i,r=this.currentLang){nO(this.translations[r],t,Pm(i)?this.compiler.compile(i,r):this.compiler.compileTranslations(i,r)),this.updateLangs(),this.onTranslationChange.emit({lang:r,translations:this.translations[r]})}changeDefaultLang(t){this.defaultLang=t,this.onDefaultLangChange.emit({lang:t,translations:this.translations[t]})}reloadLang(t){return this.resetLang(t),this.loadAndCompileTranslations(t)}resetLang(t){delete this._translationRequests[t],delete this.translations[t]}getBrowserLang(){if(typeof window>"u"||!window.navigator)return;let t=this.getBrowserCultureLang();return t?t.split(/[-_]/)[0]:void 0}getBrowserCultureLang(){if(!(typeof window>"u"||typeof window.navigator>"u"))return window.navigator.languages?window.navigator.languages[0]:window.navigator.language||window.navigator.browserLanguage||window.navigator.userLanguage}static \u0275fac=function(i){return new(i||n)(F(qs),F(pi),F(Pr),F(Rr),F(Gs),F(Qu),F(Zu),F(ed),F(Ju))};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var un=(()=>{class n{translate;_ref;value="";lastKey=null;lastParams=[];onTranslationChange;onLangChange;onDefaultLangChange;constructor(t,i){this.translate=t,this._ref=i}updateValue(t,i,r){let s=o=>{this.value=o!==void 0?o:t,this.lastKey=t,this._ref.markForCheck()};if(r){let o=this.translate.getParsedResult(r,t,i);Yn(o)?o.subscribe(s):s(o)}this.translate.get(t,i).subscribe(s)}transform(t,...i){if(!t||!t.length)return t;if(Ku(t,this.lastKey)&&Ku(i,this.lastParams))return this.value;let r;if(Bi(i[0])&&i.length)if(Pm(i[0])&&i[0].length){let s=i[0].replace(/(')?([a-zA-Z0-9_]+)(')?(\s)?:/g,'"$2":').replace(/:(\s)?(')(.*?)(')/g,':"$3"');try{r=JSON.parse(s)}catch(o){throw new SyntaxError(`Wrong parameter in TranslatePipe. Expected a valid Object, received: ${i[0]}`)}}else Ma(i[0])&&(r=i[0]);return this.lastKey=t,this.lastParams=i,this.updateValue(t,r),this._dispose(),this.onTranslationChange||(this.onTranslationChange=this.translate.onTranslationChange.subscribe(s=>{this.lastKey&&s.lang===this.translate.currentLang&&(this.lastKey=null,this.updateValue(t,r,s.translations))})),this.onLangChange||(this.onLangChange=this.translate.onLangChange.subscribe(s=>{this.lastKey&&(this.lastKey=null,this.updateValue(t,r,s.translations))})),this.onDefaultLangChange||(this.onDefaultLangChange=this.translate.onDefaultLangChange.subscribe(()=>{this.lastKey&&(this.lastKey=null,this.updateValue(t,r))})),this.value}_dispose(){typeof this.onTranslationChange<"u"&&(this.onTranslationChange.unsubscribe(),this.onTranslationChange=void 0),typeof this.onLangChange<"u"&&(this.onLangChange.unsubscribe(),this.onLangChange=void 0),typeof this.onDefaultLangChange<"u"&&(this.onDefaultLangChange.unsubscribe(),this.onDefaultLangChange=void 0)}ngOnDestroy(){this._dispose()}static \u0275fac=function(i){return new(i||n)(j(Bn,16),j(Cr,16))};static \u0275pipe=Yc({name:"translate",type:n,pure:!1});static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})();var SA=(n={})=>mr([n.loader||{provide:pi,useClass:Dm},n.compiler||{provide:Pr,useClass:Mm},n.parser||{provide:Rr,useClass:Tm},n.missingTranslationHandler||{provide:Gs,useClass:Sm},qs,{provide:Zu,useValue:n.isolate},{provide:Qu,useValue:n.useDefaultLang},{provide:ed,useValue:n.extend},{provide:Ju,useValue:n.defaultLanguage},Bn]),xA=(()=>{class n{static forRoot(t={}){return{ngModule:n,providers:[t.loader||{provide:pi,useClass:Dm},t.compiler||{provide:Pr,useClass:Mm},t.parser||{provide:Rr,useClass:Tm},t.missingTranslationHandler||{provide:Gs,useClass:Sm},qs,{provide:Zu,useValue:t.isolate},{provide:Qu,useValue:t.useDefaultLang},{provide:ed,useValue:t.extend},{provide:Ju,useValue:t.defaultLanguage},Bn]}}static forChild(t={}){return{ngModule:n,providers:[t.loader||{provide:pi,useClass:Dm},t.compiler||{provide:Pr,useClass:Mm},t.parser||{provide:Rr,useClass:Tm},t.missingTranslationHandler||{provide:Gs,useClass:Sm},{provide:Zu,useValue:t.isolate},{provide:Qu,useValue:t.useDefaultLang},{provide:ed,useValue:t.extend},{provide:Ju,useValue:t.defaultLanguage},Bn]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=Gt({type:n});static \u0275inj=$t({})}return n})();var ft=[];for(let n=0;n<256;++n)ft.push((n+256).toString(16).slice(1));function IA(n,e=0){return(ft[n[e+0]]+ft[n[e+1]]+ft[n[e+2]]+ft[n[e+3]]+"-"+ft[n[e+4]]+ft[n[e+5]]+"-"+ft[n[e+6]]+ft[n[e+7]]+"-"+ft[n[e+8]]+ft[n[e+9]]+"-"+ft[n[e+10]]+ft[n[e+11]]+ft[n[e+12]]+ft[n[e+13]]+ft[n[e+14]]+ft[n[e+15]]).toLowerCase()}var km,iO=new Uint8Array(16);function Om(){if(!km){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");km=crypto.getRandomValues.bind(crypto)}return km(iO)}var rO=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Lm={randomUUID:rO};function sO(n,e,t){if(Lm.randomUUID&&!e&&!n)return Lm.randomUUID();n=n||{};let i=n.random??n.rng?.()??Om();if(i.length<16)throw new Error("Random bytes length must be >= 16");if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){if(t=t||0,t<0||t+16>e.length)throw new RangeError(`UUID byte range ${t}:${t+15} is out of buffer bounds`);for(let r=0;r<16;++r)e[t+r]=i[r];return e}return IA(i)}var Ra=sO;var Fm={channel:"DVS",version:"1.0.0"};var gi={production:!0,baseUrl:"https://online-new.alinma.com/",CGWApiEndpoint:"https://api-gw.alinma.com/alinma-apim/channels-api/",enableDebugTools:!1,isMock:!1,channel:"DVS",CGWPrefix:"channels-api","X-IBM-Client-Id-CGW":"0d3f5c7ac68b3675f5f7a5e21c3f10b3","X-IBM-Client-Secret-CGW":"dca21c86685241813f31fa0008c6f5c7"};var Ui=class n{isShown=ze(!1);loadersCount=ze(0);constructor(){ki(()=>{this.isShown.update(()=>this.loadersCount()>0)})}show(){this.loadersCount.update(e=>++e)}hide(){this.loadersCount.update(e=>--e)}forceHide(){this.isShown.update(()=>!1)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ys=class n{constructor(e,t){this.http=e;this.pageLoaderService=t;this.baseUrl=this.MSDirectFlag()?gi.baseUrl:gi.CGWApiEndpoint}baseUrl;MSDirectFlag=ze(!1);call(e){e.method=e?.method||"GET";let{method:t,endpoint:i,body:r,queryParams:s,headers:o,category:a}=e,l=`${this.baseUrl}${a||"api"}/${i}`,c=this.MSDirectFlag()?{observe:"response"}:{observe:"response",headers:new Ln({"X-IBM-Client-Id":gi["X-IBM-Client-Id-CGW"],"X-IBM-Client-Secret":gi["X-IBM-Client-Secret-CGW"]})};switch(o&&(c.headers=o),s&&(c.params=new _n({fromObject:s})),t){case"GET":return this.http.get(l,c).pipe(st(u=>{throw console.error("GET request failed",u),u}));case"POST":return this.http.post(l,r,c).pipe(st(u=>{throw console.error("POST request failed",u),u}));case"PUT":return this.http.put(l,r,c).pipe(st(u=>{throw console.error("PUT request failed",u),u}));case"DELETE":return this.http.delete(l,c).pipe(st(u=>{throw console.error("DELETE request failed",u),u}));default:throw new Error(`Unsupported method: ${t}`)}}static \u0275fac=function(t){return new(t||n)(F(Li),F(Ui))};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})};var Cn=class n{constructor(e){this.xhrService=e;localStorage.getItem("UUID")||localStorage.setItem("UUID",Ra())}token="";authenticate(){return this.token?U(!0):this.xhrService.call({method:"POST",endpoint:`authentication/v1/${Fm.channel}/auth`,category:"retail",body:{codeVersion:Fm.version,device:localStorage.getItem("UUID"),timezone:Intl?.DateTimeFormat()?.resolvedOptions()?.timeZone||""}}).pipe(z(e=>(this.token=e.headers.get("authorization"),e)))}static \u0275fac=function(t){return new(t||n)(F(Ys))};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})};var Pa=class n{constructor(e){this.router=e;this.getConfig()}authService=T(Cn);getConfig(){this.authService.authenticate().subscribe({next:e=>{this.router.navigate(["search"])},error:e=>{console.error("Error:",e)}})}static \u0275fac=function(t){return new(t||n)(j(Ws))};static \u0275cmp=ye({type:n,selectors:[["dvs-landing"]],decls:0,vars:0,template:function(t,i){},encapsulation:2})};var wt=class n{constructor(e){this.translate=e;this.language=new et(this.initialLang)}language;initialLang=localStorage.getItem("lang")||"en";init(){this.translate.addLangs(["ar","en"]),this.translate.setDefaultLang("en"),this.setCurrentLang(this.getCurrentLang()),this.updateBodyDirection(this.initialLang)}get onLangChange(){return this.language}getCurrentLang(){return this.language.getValue()}setCurrentLang(e){this.translate.setDefaultLang(e),this.translate.use(e),this.language.next(e)}isArabic(){return this.getCurrentLang()==="ar"}isEnglish(){return this.getCurrentLang()==="en"}isRTL(){return this.isArabic()}isLTR(){return this.isEnglish()}toggleLang(){let t=this.getCurrentLang()==="en"?"ar":"en";localStorage.setItem("lang",t),window.location.reload()}updateBodyDirection(e){document.body.dir=e==="ar"?"rtl":"ltr"}static \u0275fac=function(t){return new(t||n)(F(Bn))};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})};var aO=["*"],td=class n{langService=T(wt);isRtl=this.langService.isRTL();static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ye({type:n,selectors:[["dvs-card"]],ngContentSelectors:aO,decls:2,vars:1,consts:[[1,"rounded-4xl","min-w-full","p-5","sm:p-8","bg-cardBg","text-cardText","bg-cardBgColor",3,"ngClass"]],template:function(t,i){t&1&&(RE(),k(0,"div",0),PE(1),N()),t&2&&W("ngClass",i.isRtl?"bg-cardBgRtl":"bg-cardBg")},dependencies:[lt,qt],encapsulation:2})};var VA=(()=>{class n{_renderer;_elementRef;onChange=t=>{};onTouched=()=>{};constructor(t,i){this._renderer=t,this._elementRef=i}setProperty(t,i){this._renderer.setProperty(this._elementRef.nativeElement,t,i)}registerOnTouched(t){this.onTouched=t}registerOnChange(t){this.onChange=t}setDisabledState(t){this.setProperty("disabled",t)}static \u0275fac=function(i){return new(i||n)(j(br),j(Lt))};static \u0275dir=We({type:n})}return n})(),Hm=(()=>{class n extends VA{static \u0275fac=(()=>{let t;return function(r){return(t||(t=mn(n)))(r||n)}})();static \u0275dir=We({type:n,features:[vn]})}return n})(),Fa=new L("");var lO={provide:Fa,useExisting:ni(()=>Qs),multi:!0};function cO(){let n=ln()?ln().getUserAgent():"";return/android (\d+)/.test(n.toLowerCase())}var uO=new L(""),Qs=(()=>{class n extends VA{_compositionMode;_composing=!1;constructor(t,i,r){super(t,i),this._compositionMode=r,this._compositionMode==null&&(this._compositionMode=!cO())}writeValue(t){let i=t??"";this.setProperty("value",i)}_handleInput(t){(!this._compositionMode||this._compositionMode&&!this._composing)&&this.onChange(t)}_compositionStart(){this._composing=!0}_compositionEnd(t){this._composing=!1,this._compositionMode&&this.onChange(t)}static \u0275fac=function(i){return new(i||n)(j(br),j(Lt),j(uO,8))};static \u0275dir=We({type:n,selectors:[["input","formControlName","",3,"type","checkbox"],["textarea","formControlName",""],["input","formControl","",3,"type","checkbox"],["textarea","formControl",""],["input","ngModel","",3,"type","checkbox"],["textarea","ngModel",""],["","ngDefaultControl",""]],hostBindings:function(i,r){i&1&&me("input",function(o){return r._handleInput(o.target.value)})("blur",function(){return r.onTouched()})("compositionstart",function(){return r._compositionStart()})("compositionend",function(o){return r._compositionEnd(o.target.value)})},standalone:!1,features:[ai([lO]),vn]})}return n})();function $m(n){return n==null||zm(n)===0}function zm(n){return n==null?null:Array.isArray(n)||typeof n=="string"?n.length:n instanceof Set?n.size:null}var Wm=new L(""),Gm=new L(""),dO=/^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,id=class{static min(e){return hO(e)}static max(e){return fO(e)}static required(e){return pO(e)}static requiredTrue(e){return gO(e)}static email(e){return mO(e)}static minLength(e){return vO(e)}static maxLength(e){return yO(e)}static pattern(e){return bO(e)}static nullValidator(e){return jA()}static compose(e){return WA(e)}static composeAsync(e){return qA(e)}};function hO(n){return e=>{if(e.value==null||n==null)return null;let t=parseFloat(e.value);return!isNaN(t)&&t{if(e.value==null||n==null)return null;let t=parseFloat(e.value);return!isNaN(t)&&t>n?{max:{max:n,actual:e.value}}:null}}function pO(n){return $m(n.value)?{required:!0}:null}function gO(n){return n.value===!0?null:{required:!0}}function mO(n){return $m(n.value)||dO.test(n.value)?null:{email:!0}}function vO(n){return e=>{let t=e.value?.length??zm(e.value);return t===null||t===0?null:t{let t=e.value?.length??zm(e.value);return t!==null&&t>n?{maxlength:{requiredLength:n,actualLength:t}}:null}}function bO(n){if(!n)return jA;let e,t;return typeof n=="string"?(t="",n.charAt(0)!=="^"&&(t+="^"),t+=n,n.charAt(n.length-1)!=="$"&&(t+="$"),e=new RegExp(t)):(t=n.toString(),e=n),i=>{if($m(i.value))return null;let r=i.value;return e.test(r)?null:{pattern:{requiredPattern:t,actualValue:r}}}}function jA(n){return null}function BA(n){return n!=null}function UA(n){return wr(n)?Ae(n):n}function HA(n){let e={};return n.forEach(t=>{e=t!=null?x(x({},e),t):e}),Object.keys(e).length===0?null:e}function $A(n,e){return e.map(t=>t(n))}function wO(n){return!n.validate}function zA(n){return n.map(e=>wO(e)?e:t=>e.validate(t))}function WA(n){if(!n)return null;let e=n.filter(BA);return e.length==0?null:function(t){return HA($A(t,e))}}function GA(n){return n!=null?WA(zA(n)):null}function qA(n){if(!n)return null;let e=n.filter(BA);return e.length==0?null:function(t){let i=$A(t,e).map(UA);return wo(i).pipe(z(HA))}}function YA(n){return n!=null?qA(zA(n)):null}function RA(n,e){return n===null?[e]:Array.isArray(n)?[...n,e]:[n,e]}function XA(n){return n._rawValidators}function KA(n){return n._rawAsyncValidators}function jm(n){return n?Array.isArray(n)?n:[n]:[]}function rd(n,e){return Array.isArray(n)?n.includes(e):n===e}function PA(n,e){let t=jm(e);return jm(n).forEach(r=>{rd(t,r)||t.push(r)}),t}function NA(n,e){return jm(e).filter(t=>!rd(n,t))}var sd=class{get value(){return this.control?this.control.value:null}get valid(){return this.control?this.control.valid:null}get invalid(){return this.control?this.control.invalid:null}get pending(){return this.control?this.control.pending:null}get disabled(){return this.control?this.control.disabled:null}get enabled(){return this.control?this.control.enabled:null}get errors(){return this.control?this.control.errors:null}get pristine(){return this.control?this.control.pristine:null}get dirty(){return this.control?this.control.dirty:null}get touched(){return this.control?this.control.touched:null}get status(){return this.control?this.control.status:null}get untouched(){return this.control?this.control.untouched:null}get statusChanges(){return this.control?this.control.statusChanges:null}get valueChanges(){return this.control?this.control.valueChanges:null}get path(){return null}_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators=[];_rawAsyncValidators=[];_setValidators(e){this._rawValidators=e||[],this._composedValidatorFn=GA(this._rawValidators)}_setAsyncValidators(e){this._rawAsyncValidators=e||[],this._composedAsyncValidatorFn=YA(this._rawAsyncValidators)}get validator(){return this._composedValidatorFn||null}get asyncValidator(){return this._composedAsyncValidatorFn||null}_onDestroyCallbacks=[];_registerOnDestroy(e){this._onDestroyCallbacks.push(e)}_invokeOnDestroyCallbacks(){this._onDestroyCallbacks.forEach(e=>e()),this._onDestroyCallbacks=[]}reset(e=void 0){this.control&&this.control.reset(e)}hasError(e,t){return this.control?this.control.hasError(e,t):!1}getError(e,t){return this.control?this.control.getError(e,t):null}},Zs=class extends sd{name;get formDirective(){return null}get path(){return null}},Nr=class extends sd{_parent=null;name=null;valueAccessor=null},od=class{_cd;constructor(e){this._cd=e}get isTouched(){return this._cd?.control?._touched?.(),!!this._cd?.control?.touched}get isUntouched(){return!!this._cd?.control?.untouched}get isPristine(){return this._cd?.control?._pristine?.(),!!this._cd?.control?.pristine}get isDirty(){return!!this._cd?.control?.dirty}get isValid(){return this._cd?.control?._status?.(),!!this._cd?.control?.valid}get isInvalid(){return!!this._cd?.control?.invalid}get isPending(){return!!this._cd?.control?.pending}get isSubmitted(){return this._cd?._submitted?.(),!!this._cd?.submitted}},_O={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},Kq=G(x({},_O),{"[class.ng-submitted]":"isSubmitted"}),Js=(()=>{class n extends od{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(j(Nr,2))};static \u0275dir=We({type:n,selectors:[["","formControlName",""],["","ngModel",""],["","formControl",""]],hostVars:14,hostBindings:function(i,r){i&2&&Xc("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)},standalone:!1,features:[vn]})}return n})(),ZA=(()=>{class n extends od{constructor(t){super(t)}static \u0275fac=function(i){return new(i||n)(j(Zs,10))};static \u0275dir=We({type:n,selectors:[["","formGroupName",""],["","formArrayName",""],["","ngModelGroup",""],["","formGroup",""],["form",3,"ngNoForm",""],["","ngForm",""]],hostVars:16,hostBindings:function(i,r){i&2&&Xc("ng-untouched",r.isUntouched)("ng-touched",r.isTouched)("ng-pristine",r.isPristine)("ng-dirty",r.isDirty)("ng-valid",r.isValid)("ng-invalid",r.isInvalid)("ng-pending",r.isPending)("ng-submitted",r.isSubmitted)},standalone:!1,features:[vn]})}return n})();var Na="VALID",nd="INVALID",Xs="PENDING",ka="DISABLED",Hi=class{},ad=class extends Hi{value;source;constructor(e,t){super(),this.value=e,this.source=t}},Oa=class extends Hi{pristine;source;constructor(e,t){super(),this.pristine=e,this.source=t}},La=class extends Hi{touched;source;constructor(e,t){super(),this.touched=e,this.source=t}},Ks=class extends Hi{status;source;constructor(e,t){super(),this.status=e,this.source=t}},Bm=class extends Hi{source;constructor(e){super(),this.source=e}},Um=class extends Hi{source;constructor(e){super(),this.source=e}};function QA(n){return(pd(n)?n.validators:n)||null}function EO(n){return Array.isArray(n)?GA(n):n||null}function JA(n,e){return(pd(e)?e.asyncValidators:n)||null}function CO(n){return Array.isArray(n)?YA(n):n||null}function pd(n){return n!=null&&!Array.isArray(n)&&typeof n=="object"}function AO(n,e,t){let i=n.controls;if(!(e?Object.keys(i):i).length)throw new O(1e3,"");if(!i[t])throw new O(1001,"")}function DO(n,e,t){n._forEachChild((i,r)=>{if(t[r]===void 0)throw new O(1002,"")})}var ld=class{_pendingDirty=!1;_hasOwnPendingAsyncValidator=null;_pendingTouched=!1;_onCollectionChange=()=>{};_updateOn;_parent=null;_asyncValidationSubscription;_composedValidatorFn;_composedAsyncValidatorFn;_rawValidators;_rawAsyncValidators;value;constructor(e,t){this._assignValidators(e),this._assignAsyncValidators(t)}get validator(){return this._composedValidatorFn}set validator(e){this._rawValidators=this._composedValidatorFn=e}get asyncValidator(){return this._composedAsyncValidatorFn}set asyncValidator(e){this._rawAsyncValidators=this._composedAsyncValidatorFn=e}get parent(){return this._parent}get status(){return li(this.statusReactive)}set status(e){li(()=>this.statusReactive.set(e))}_status=Ar(()=>this.statusReactive());statusReactive=ze(void 0);get valid(){return this.status===Na}get invalid(){return this.status===nd}get pending(){return this.status==Xs}get disabled(){return this.status===ka}get enabled(){return this.status!==ka}errors;get pristine(){return li(this.pristineReactive)}set pristine(e){li(()=>this.pristineReactive.set(e))}_pristine=Ar(()=>this.pristineReactive());pristineReactive=ze(!0);get dirty(){return!this.pristine}get touched(){return li(this.touchedReactive)}set touched(e){li(()=>this.touchedReactive.set(e))}_touched=Ar(()=>this.touchedReactive());touchedReactive=ze(!1);get untouched(){return!this.touched}_events=new Se;events=this._events.asObservable();valueChanges;statusChanges;get updateOn(){return this._updateOn?this._updateOn:this.parent?this.parent.updateOn:"change"}setValidators(e){this._assignValidators(e)}setAsyncValidators(e){this._assignAsyncValidators(e)}addValidators(e){this.setValidators(PA(e,this._rawValidators))}addAsyncValidators(e){this.setAsyncValidators(PA(e,this._rawAsyncValidators))}removeValidators(e){this.setValidators(NA(e,this._rawValidators))}removeAsyncValidators(e){this.setAsyncValidators(NA(e,this._rawAsyncValidators))}hasValidator(e){return rd(this._rawValidators,e)}hasAsyncValidator(e){return rd(this._rawAsyncValidators,e)}clearValidators(){this.validator=null}clearAsyncValidators(){this.asyncValidator=null}markAsTouched(e={}){let t=this.touched===!1;this.touched=!0;let i=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsTouched(G(x({},e),{sourceControl:i})),t&&e.emitEvent!==!1&&this._events.next(new La(!0,i))}markAllAsTouched(e={}){this.markAsTouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:this}),this._forEachChild(t=>t.markAllAsTouched(e))}markAsUntouched(e={}){let t=this.touched===!0;this.touched=!1,this._pendingTouched=!1;let i=e.sourceControl??this;this._forEachChild(r=>{r.markAsUntouched({onlySelf:!0,emitEvent:e.emitEvent,sourceControl:i})}),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,i),t&&e.emitEvent!==!1&&this._events.next(new La(!1,i))}markAsDirty(e={}){let t=this.pristine===!0;this.pristine=!1;let i=e.sourceControl??this;this._parent&&!e.onlySelf&&this._parent.markAsDirty(G(x({},e),{sourceControl:i})),t&&e.emitEvent!==!1&&this._events.next(new Oa(!1,i))}markAsPristine(e={}){let t=this.pristine===!1;this.pristine=!0,this._pendingDirty=!1;let i=e.sourceControl??this;this._forEachChild(r=>{r.markAsPristine({onlySelf:!0,emitEvent:e.emitEvent})}),this._parent&&!e.onlySelf&&this._parent._updatePristine(e,i),t&&e.emitEvent!==!1&&this._events.next(new Oa(!0,i))}markAsPending(e={}){this.status=Xs;let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new Ks(this.status,t)),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.markAsPending(G(x({},e),{sourceControl:t}))}disable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=ka,this.errors=null,this._forEachChild(r=>{r.disable(G(x({},e),{onlySelf:!0}))}),this._updateValue();let i=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new ad(this.value,i)),this._events.next(new Ks(this.status,i)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._updateAncestors(G(x({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(r=>r(!0))}enable(e={}){let t=this._parentMarkedDirty(e.onlySelf);this.status=Na,this._forEachChild(i=>{i.enable(G(x({},e),{onlySelf:!0}))}),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent}),this._updateAncestors(G(x({},e),{skipPristineCheck:t}),this),this._onDisabledChange.forEach(i=>i(!1))}_updateAncestors(e,t){this._parent&&!e.onlySelf&&(this._parent.updateValueAndValidity(e),e.skipPristineCheck||this._parent._updatePristine({},t),this._parent._updateTouched({},t))}setParent(e){this._parent=e}getRawValue(){return this.value}updateValueAndValidity(e={}){if(this._setInitialStatus(),this._updateValue(),this.enabled){let i=this._cancelExistingSubscription();this.errors=this._runValidator(),this.status=this._calculateStatus(),(this.status===Na||this.status===Xs)&&this._runAsyncValidator(i,e.emitEvent)}let t=e.sourceControl??this;e.emitEvent!==!1&&(this._events.next(new ad(this.value,t)),this._events.next(new Ks(this.status,t)),this.valueChanges.emit(this.value),this.statusChanges.emit(this.status)),this._parent&&!e.onlySelf&&this._parent.updateValueAndValidity(G(x({},e),{sourceControl:t}))}_updateTreeValidity(e={emitEvent:!0}){this._forEachChild(t=>t._updateTreeValidity(e)),this.updateValueAndValidity({onlySelf:!0,emitEvent:e.emitEvent})}_setInitialStatus(){this.status=this._allControlsDisabled()?ka:Na}_runValidator(){return this.validator?this.validator(this):null}_runAsyncValidator(e,t){if(this.asyncValidator){this.status=Xs,this._hasOwnPendingAsyncValidator={emitEvent:t!==!1};let i=UA(this.asyncValidator(this));this._asyncValidationSubscription=i.subscribe(r=>{this._hasOwnPendingAsyncValidator=null,this.setErrors(r,{emitEvent:t,shouldHaveEmitted:e})})}}_cancelExistingSubscription(){if(this._asyncValidationSubscription){this._asyncValidationSubscription.unsubscribe();let e=this._hasOwnPendingAsyncValidator?.emitEvent??!1;return this._hasOwnPendingAsyncValidator=null,e}return!1}setErrors(e,t={}){this.errors=e,this._updateControlsErrors(t.emitEvent!==!1,this,t.shouldHaveEmitted)}get(e){let t=e;return t==null||(Array.isArray(t)||(t=t.split(".")),t.length===0)?null:t.reduce((i,r)=>i&&i._find(r),this)}getError(e,t){let i=t?this.get(t):this;return i&&i.errors?i.errors[e]:null}hasError(e,t){return!!this.getError(e,t)}get root(){let e=this;for(;e._parent;)e=e._parent;return e}_updateControlsErrors(e,t,i){this.status=this._calculateStatus(),e&&this.statusChanges.emit(this.status),(e||i)&&this._events.next(new Ks(this.status,t)),this._parent&&this._parent._updateControlsErrors(e,t,i)}_initObservables(){this.valueChanges=new oe,this.statusChanges=new oe}_calculateStatus(){return this._allControlsDisabled()?ka:this.errors?nd:this._hasOwnPendingAsyncValidator||this._anyControlsHaveStatus(Xs)?Xs:this._anyControlsHaveStatus(nd)?nd:Na}_anyControlsHaveStatus(e){return this._anyControls(t=>t.status===e)}_anyControlsDirty(){return this._anyControls(e=>e.dirty)}_anyControlsTouched(){return this._anyControls(e=>e.touched)}_updatePristine(e,t){let i=!this._anyControlsDirty(),r=this.pristine!==i;this.pristine=i,this._parent&&!e.onlySelf&&this._parent._updatePristine(e,t),r&&this._events.next(new Oa(this.pristine,t))}_updateTouched(e={},t){this.touched=this._anyControlsTouched(),this._events.next(new La(this.touched,t)),this._parent&&!e.onlySelf&&this._parent._updateTouched(e,t)}_onDisabledChange=[];_registerOnCollectionChange(e){this._onCollectionChange=e}_setUpdateStrategy(e){pd(e)&&e.updateOn!=null&&(this._updateOn=e.updateOn)}_parentMarkedDirty(e){let t=this._parent&&this._parent.dirty;return!e&&!!t&&!this._parent._anyControlsDirty()}_find(e){return null}_assignValidators(e){this._rawValidators=Array.isArray(e)?e.slice():e,this._composedValidatorFn=EO(this._rawValidators)}_assignAsyncValidators(e){this._rawAsyncValidators=Array.isArray(e)?e.slice():e,this._composedAsyncValidatorFn=CO(this._rawAsyncValidators)}},cd=class extends ld{constructor(e,t,i){super(QA(t),JA(i,t)),this.controls=e,this._initObservables(),this._setUpdateStrategy(t),this._setUpControls(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator})}controls;registerControl(e,t){return this.controls[e]?this.controls[e]:(this.controls[e]=t,t.setParent(this),t._registerOnCollectionChange(this._onCollectionChange),t)}addControl(e,t,i={}){this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}removeControl(e,t={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],this.updateValueAndValidity({emitEvent:t.emitEvent}),this._onCollectionChange()}setControl(e,t,i={}){this.controls[e]&&this.controls[e]._registerOnCollectionChange(()=>{}),delete this.controls[e],t&&this.registerControl(e,t),this.updateValueAndValidity({emitEvent:i.emitEvent}),this._onCollectionChange()}contains(e){return this.controls.hasOwnProperty(e)&&this.controls[e].enabled}setValue(e,t={}){DO(this,!0,e),Object.keys(e).forEach(i=>{AO(this,!0,i),this.controls[i].setValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t)}patchValue(e,t={}){e!=null&&(Object.keys(e).forEach(i=>{let r=this.controls[i];r&&r.patchValue(e[i],{onlySelf:!0,emitEvent:t.emitEvent})}),this.updateValueAndValidity(t))}reset(e={},t={}){this._forEachChild((i,r)=>{i.reset(e?e[r]:null,{onlySelf:!0,emitEvent:t.emitEvent})}),this._updatePristine(t,this),this._updateTouched(t,this),this.updateValueAndValidity(t)}getRawValue(){return this._reduceChildren({},(e,t,i)=>(e[i]=t.getRawValue(),e))}_syncPendingControls(){let e=this._reduceChildren(!1,(t,i)=>i._syncPendingControls()?!0:t);return e&&this.updateValueAndValidity({onlySelf:!0}),e}_forEachChild(e){Object.keys(this.controls).forEach(t=>{let i=this.controls[t];i&&e(i,t)})}_setUpControls(){this._forEachChild(e=>{e.setParent(this),e._registerOnCollectionChange(this._onCollectionChange)})}_updateValue(){this.value=this._reduceValue()}_anyControls(e){for(let[t,i]of Object.entries(this.controls))if(this.contains(t)&&e(i))return!0;return!1}_reduceValue(){let e={};return this._reduceChildren(e,(t,i,r)=>((i.enabled||this.disabled)&&(t[r]=i.value),t))}_reduceChildren(e,t){let i=e;return this._forEachChild((r,s)=>{i=t(i,r,s)}),i}_allControlsDisabled(){for(let e of Object.keys(this.controls))if(this.controls[e].enabled)return!1;return Object.keys(this.controls).length>0||this.disabled}_find(e){return this.controls.hasOwnProperty(e)?this.controls[e]:null}};var Va=new L("",{providedIn:"root",factory:()=>gd}),gd="always";function SO(n,e){return[...e.path,n]}function ud(n,e,t=gd){qm(n,e),e.valueAccessor.writeValue(n.value),(n.disabled||t==="always")&&e.valueAccessor.setDisabledState?.(n.disabled),IO(n,e),MO(n,e),TO(n,e),xO(n,e)}function dd(n,e,t=!0){let i=()=>{};e.valueAccessor&&(e.valueAccessor.registerOnChange(i),e.valueAccessor.registerOnTouched(i)),fd(n,e),n&&(e._invokeOnDestroyCallbacks(),n._registerOnCollectionChange(()=>{}))}function hd(n,e){n.forEach(t=>{t.registerOnValidatorChange&&t.registerOnValidatorChange(e)})}function xO(n,e){if(e.valueAccessor.setDisabledState){let t=i=>{e.valueAccessor.setDisabledState(i)};n.registerOnDisabledChange(t),e._registerOnDestroy(()=>{n._unregisterOnDisabledChange(t)})}}function qm(n,e){let t=XA(n);e.validator!==null?n.setValidators(RA(t,e.validator)):typeof t=="function"&&n.setValidators([t]);let i=KA(n);e.asyncValidator!==null?n.setAsyncValidators(RA(i,e.asyncValidator)):typeof i=="function"&&n.setAsyncValidators([i]);let r=()=>n.updateValueAndValidity();hd(e._rawValidators,r),hd(e._rawAsyncValidators,r)}function fd(n,e){let t=!1;if(n!==null){if(e.validator!==null){let r=XA(n);if(Array.isArray(r)&&r.length>0){let s=r.filter(o=>o!==e.validator);s.length!==r.length&&(t=!0,n.setValidators(s))}}if(e.asyncValidator!==null){let r=KA(n);if(Array.isArray(r)&&r.length>0){let s=r.filter(o=>o!==e.asyncValidator);s.length!==r.length&&(t=!0,n.setAsyncValidators(s))}}}let i=()=>{};return hd(e._rawValidators,i),hd(e._rawAsyncValidators,i),t}function IO(n,e){e.valueAccessor.registerOnChange(t=>{n._pendingValue=t,n._pendingChange=!0,n._pendingDirty=!0,n.updateOn==="change"&&eD(n,e)})}function TO(n,e){e.valueAccessor.registerOnTouched(()=>{n._pendingTouched=!0,n.updateOn==="blur"&&n._pendingChange&&eD(n,e),n.updateOn!=="submit"&&n.markAsTouched()})}function eD(n,e){n._pendingDirty&&n.markAsDirty(),n.setValue(n._pendingValue,{emitModelToViewChange:!1}),e.viewToModelUpdate(n._pendingValue),n._pendingChange=!1}function MO(n,e){let t=(i,r)=>{e.valueAccessor.writeValue(i),r&&e.viewToModelUpdate(i)};n.registerOnChange(t),e._registerOnDestroy(()=>{n._unregisterOnChange(t)})}function RO(n,e){n==null,qm(n,e)}function PO(n,e){return fd(n,e)}function tD(n,e){if(!n.hasOwnProperty("model"))return!1;let t=n.model;return t.isFirstChange()?!0:!Object.is(e,t.currentValue)}function NO(n){return Object.getPrototypeOf(n.constructor)===Hm}function kO(n,e){n._syncPendingControls(),e.forEach(t=>{let i=t.control;i.updateOn==="submit"&&i._pendingChange&&(t.viewToModelUpdate(i._pendingValue),i._pendingChange=!1)})}function nD(n,e){if(!e)return null;Array.isArray(e);let t,i,r;return e.forEach(s=>{s.constructor===Qs?t=s:NO(s)?i=s:r=s}),r||i||t||null}function OO(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function kA(n,e){let t=n.indexOf(e);t>-1&&n.splice(t,1)}function OA(n){return typeof n=="object"&&n!==null&&Object.keys(n).length===2&&"value"in n&&"disabled"in n}var md=class extends ld{defaultValue=null;_onChange=[];_pendingValue;_pendingChange=!1;constructor(e=null,t,i){super(QA(t),JA(i,t)),this._applyFormState(e),this._setUpdateStrategy(t),this._initObservables(),this.updateValueAndValidity({onlySelf:!0,emitEvent:!!this.asyncValidator}),pd(t)&&(t.nonNullable||t.initialValueIsDefault)&&(OA(e)?this.defaultValue=e.value:this.defaultValue=e)}setValue(e,t={}){this.value=this._pendingValue=e,this._onChange.length&&t.emitModelToViewChange!==!1&&this._onChange.forEach(i=>i(this.value,t.emitViewToModelChange!==!1)),this.updateValueAndValidity(t)}patchValue(e,t={}){this.setValue(e,t)}reset(e=this.defaultValue,t={}){this._applyFormState(e),this.markAsPristine(t),this.markAsUntouched(t),this.setValue(this.value,t),this._pendingChange=!1}_updateValue(){}_anyControls(e){return!1}_allControlsDisabled(){return this.disabled}registerOnChange(e){this._onChange.push(e)}_unregisterOnChange(e){kA(this._onChange,e)}registerOnDisabledChange(e){this._onDisabledChange.push(e)}_unregisterOnDisabledChange(e){kA(this._onDisabledChange,e)}_forEachChild(e){}_syncPendingControls(){return this.updateOn==="submit"&&(this._pendingDirty&&this.markAsDirty(),this._pendingTouched&&this.markAsTouched(),this._pendingChange)?(this.setValue(this._pendingValue,{onlySelf:!0,emitModelToViewChange:!1}),!0):!1}_applyFormState(e){OA(e)?(this.value=this._pendingValue=e.value,e.disabled?this.disable({onlySelf:!0,emitEvent:!1}):this.enable({onlySelf:!0,emitEvent:!1})):this.value=this._pendingValue=e}};var LO=n=>n instanceof md;var FO={provide:Nr,useExisting:ni(()=>ja)},LA=Promise.resolve(),ja=(()=>{class n extends Nr{_changeDetectorRef;callSetDisabledState;control=new md;static ngAcceptInputType_isDisabled;_registered=!1;viewModel;name="";isDisabled;model;options;update=new oe;constructor(t,i,r,s,o,a){super(),this._changeDetectorRef=o,this.callSetDisabledState=a,this._parent=t,this._setValidators(i),this._setAsyncValidators(r),this.valueAccessor=nD(this,s)}ngOnChanges(t){if(this._checkForErrors(),!this._registered||"name"in t){if(this._registered&&(this._checkName(),this.formDirective)){let i=t.name.previousValue;this.formDirective.removeControl({name:i,path:this._getPath(i)})}this._setUpControl()}"isDisabled"in t&&this._updateDisabled(t),tD(t,this.viewModel)&&(this._updateValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.formDirective&&this.formDirective.removeControl(this)}get path(){return this._getPath(this.name)}get formDirective(){return this._parent?this._parent.formDirective:null}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_setUpControl(){this._setUpdateStrategy(),this._isStandalone()?this._setUpStandalone():this.formDirective.addControl(this),this._registered=!0}_setUpdateStrategy(){this.options&&this.options.updateOn!=null&&(this.control._updateOn=this.options.updateOn)}_isStandalone(){return!this._parent||!!(this.options&&this.options.standalone)}_setUpStandalone(){ud(this.control,this,this.callSetDisabledState),this.control.updateValueAndValidity({emitEvent:!1})}_checkForErrors(){this._checkName()}_checkName(){this.options&&this.options.name&&(this.name=this.options.name),!this._isStandalone()&&this.name}_updateValue(t){LA.then(()=>{this.control.setValue(t,{emitViewToModelChange:!1}),this._changeDetectorRef?.markForCheck()})}_updateDisabled(t){let i=t.isDisabled.currentValue,r=i!==0&&Pg(i);LA.then(()=>{r&&!this.control.disabled?this.control.disable():!r&&this.control.disabled&&this.control.enable(),this._changeDetectorRef?.markForCheck()})}_getPath(t){return this._parent?SO(t,this._parent):[t]}static \u0275fac=function(i){return new(i||n)(j(Zs,9),j(Wm,10),j(Gm,10),j(Fa,10),j(Cr,8),j(Va,8))};static \u0275dir=We({type:n,selectors:[["","ngModel","",3,"formControlName","",3,"formControl",""]],inputs:{name:"name",isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"],options:[0,"ngModelOptions","options"]},outputs:{update:"ngModelChange"},exportAs:["ngModel"],standalone:!1,features:[ai([FO]),vn,si]})}return n})();var iD=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275dir=We({type:n,selectors:[["form",3,"ngNoForm","",3,"ngNativeValidate",""]],hostAttrs:["novalidate",""],standalone:!1})}return n})();var rD=new L(""),VO={provide:Nr,useExisting:ni(()=>Ym)},Ym=(()=>{class n extends Nr{_ngModelWarningConfig;callSetDisabledState;viewModel;form;set isDisabled(t){}model;update=new oe;static _ngModelWarningSentOnce=!1;_ngModelWarningSent=!1;constructor(t,i,r,s,o){super(),this._ngModelWarningConfig=s,this.callSetDisabledState=o,this._setValidators(t),this._setAsyncValidators(i),this.valueAccessor=nD(this,r)}ngOnChanges(t){if(this._isControlChanged(t)){let i=t.form.previousValue;i&&dd(i,this,!1),ud(this.form,this,this.callSetDisabledState),this.form.updateValueAndValidity({emitEvent:!1})}tD(t,this.viewModel)&&(this.form.setValue(this.model),this.viewModel=this.model)}ngOnDestroy(){this.form&&dd(this.form,this,!1)}get path(){return[]}get control(){return this.form}viewToModelUpdate(t){this.viewModel=t,this.update.emit(t)}_isControlChanged(t){return t.hasOwnProperty("form")}static \u0275fac=function(i){return new(i||n)(j(Wm,10),j(Gm,10),j(Fa,10),j(rD,8),j(Va,8))};static \u0275dir=We({type:n,selectors:[["","formControl",""]],inputs:{form:[0,"formControl","form"],isDisabled:[0,"disabled","isDisabled"],model:[0,"ngModel","model"]},outputs:{update:"ngModelChange"},exportAs:["ngForm"],standalone:!1,features:[ai([VO]),vn,si]})}return n})(),jO={provide:Zs,useExisting:ni(()=>Xm)},Xm=(()=>{class n extends Zs{callSetDisabledState;get submitted(){return li(this._submittedReactive)}set submitted(t){this._submittedReactive.set(t)}_submitted=Ar(()=>this._submittedReactive());_submittedReactive=ze(!1);_oldForm;_onCollectionChange=()=>this._updateDomValue();directives=[];form=null;ngSubmit=new oe;constructor(t,i,r){super(),this.callSetDisabledState=r,this._setValidators(t),this._setAsyncValidators(i)}ngOnChanges(t){t.hasOwnProperty("form")&&(this._updateValidators(),this._updateDomValue(),this._updateRegistrations(),this._oldForm=this.form)}ngOnDestroy(){this.form&&(fd(this.form,this),this.form._onCollectionChange===this._onCollectionChange&&this.form._registerOnCollectionChange(()=>{}))}get formDirective(){return this}get control(){return this.form}get path(){return[]}addControl(t){let i=this.form.get(t.path);return ud(i,t,this.callSetDisabledState),i.updateValueAndValidity({emitEvent:!1}),this.directives.push(t),i}getControl(t){return this.form.get(t.path)}removeControl(t){dd(t.control||null,t,!1),OO(this.directives,t)}addFormGroup(t){this._setUpFormContainer(t)}removeFormGroup(t){this._cleanUpFormContainer(t)}getFormGroup(t){return this.form.get(t.path)}addFormArray(t){this._setUpFormContainer(t)}removeFormArray(t){this._cleanUpFormContainer(t)}getFormArray(t){return this.form.get(t.path)}updateModel(t,i){this.form.get(t.path).setValue(i)}onSubmit(t){return this._submittedReactive.set(!0),kO(this.form,this.directives),this.ngSubmit.emit(t),this.form._events.next(new Bm(this.control)),t?.target?.method==="dialog"}onReset(){this.resetForm()}resetForm(t=void 0){this.form.reset(t),this._submittedReactive.set(!1),this.form._events.next(new Um(this.form))}_updateDomValue(){this.directives.forEach(t=>{let i=t.control,r=this.form.get(t.path);i!==r&&(dd(i||null,t),LO(r)&&(ud(r,t,this.callSetDisabledState),t.control=r))}),this.form._updateTreeValidity({emitEvent:!1})}_setUpFormContainer(t){let i=this.form.get(t.path);RO(i,t),i.updateValueAndValidity({emitEvent:!1})}_cleanUpFormContainer(t){if(this.form){let i=this.form.get(t.path);i&&PO(i,t)&&i.updateValueAndValidity({emitEvent:!1})}}_updateRegistrations(){this.form._registerOnCollectionChange(this._onCollectionChange),this._oldForm&&this._oldForm._registerOnCollectionChange(()=>{})}_updateValidators(){qm(this.form,this),this._oldForm&&fd(this._oldForm,this)}static \u0275fac=function(i){return new(i||n)(j(Wm,10),j(Gm,10),j(Va,8))};static \u0275dir=We({type:n,selectors:[["","formGroup",""]],hostBindings:function(i,r){i&1&&me("submit",function(o){return r.onSubmit(o)})("reset",function(){return r.onReset()})},inputs:{form:[0,"formGroup","form"]},outputs:{ngSubmit:"ngSubmit"},exportAs:["ngForm"],standalone:!1,features:[ai([jO]),vn,si]})}return n})();var BO={provide:Fa,useExisting:ni(()=>vd),multi:!0};function sD(n,e){return n==null?`${e}`:(e&&typeof e=="object"&&(e="Object"),`${n}: ${e}`.slice(0,50))}function UO(n){return n.split(":")[0]}var vd=(()=>{class n extends Hm{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;writeValue(t){this.value=t;let i=this._getOptionId(t),r=sD(i,t);this.setProperty("value",r)}registerOnChange(t){this.onChange=i=>{this.value=this._getOptionValue(i),t(this.value)}}_registerOption(){return(this._idCounter++).toString()}_getOptionId(t){for(let i of this._optionMap.keys())if(this._compareWith(this._optionMap.get(i),t))return i;return null}_getOptionValue(t){let i=UO(t);return this._optionMap.has(i)?this._optionMap.get(i):t}static \u0275fac=(()=>{let t;return function(r){return(t||(t=mn(n)))(r||n)}})();static \u0275dir=We({type:n,selectors:[["select","formControlName","",3,"multiple",""],["select","formControl","",3,"multiple",""],["select","ngModel","",3,"multiple",""]],hostBindings:function(i,r){i&1&&me("change",function(o){return r.onChange(o.target.value)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[ai([BO]),vn]})}return n})(),oD=(()=>{class n{_element;_renderer;_select;id;constructor(t,i,r){this._element=t,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption())}set ngValue(t){this._select!=null&&(this._select._optionMap.set(this.id,t),this._setElementValue(sD(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._setElementValue(t),this._select&&this._select.writeValue(this._select.value)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(i){return new(i||n)(j(Lt),j(br),j(vd,9))};static \u0275dir=We({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})(),HO={provide:Fa,useExisting:ni(()=>aD),multi:!0};function FA(n,e){return n==null?`${e}`:(typeof e=="string"&&(e=`'${e}'`),e&&typeof e=="object"&&(e="Object"),`${n}: ${e}`.slice(0,50))}function $O(n){return n.split(":")[0]}var aD=(()=>{class n extends Hm{value;_optionMap=new Map;_idCounter=0;set compareWith(t){this._compareWith=t}_compareWith=Object.is;writeValue(t){this.value=t;let i;if(Array.isArray(t)){let r=t.map(s=>this._getOptionId(s));i=(s,o)=>{s._setSelected(r.indexOf(o.toString())>-1)}}else i=(r,s)=>{r._setSelected(!1)};this._optionMap.forEach(i)}registerOnChange(t){this.onChange=i=>{let r=[],s=i.selectedOptions;if(s!==void 0){let o=s;for(let a=0;a{let t;return function(r){return(t||(t=mn(n)))(r||n)}})();static \u0275dir=We({type:n,selectors:[["select","multiple","","formControlName",""],["select","multiple","","formControl",""],["select","multiple","","ngModel",""]],hostBindings:function(i,r){i&1&&me("change",function(o){return r.onChange(o.target)})("blur",function(){return r.onTouched()})},inputs:{compareWith:"compareWith"},standalone:!1,features:[ai([HO]),vn]})}return n})(),lD=(()=>{class n{_element;_renderer;_select;id;_value;constructor(t,i,r){this._element=t,this._renderer=i,this._select=r,this._select&&(this.id=this._select._registerOption(this))}set ngValue(t){this._select!=null&&(this._value=t,this._setElementValue(FA(this.id,t)),this._select.writeValue(this._select.value))}set value(t){this._select?(this._value=t,this._setElementValue(FA(this.id,t)),this._select.writeValue(this._select.value)):this._setElementValue(t)}_setElementValue(t){this._renderer.setProperty(this._element.nativeElement,"value",t)}_setSelected(t){this._renderer.setProperty(this._element.nativeElement,"selected",t)}ngOnDestroy(){this._select&&(this._select._optionMap.delete(this.id),this._select.writeValue(this._select.value))}static \u0275fac=function(i){return new(i||n)(j(Lt),j(br),j(aD,9))};static \u0275dir=We({type:n,selectors:[["option"]],inputs:{ngValue:"ngValue",value:"value"},standalone:!1})}return n})();var cD=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=Gt({type:n});static \u0275inj=$t({})}return n})();var $i=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:Va,useValue:t.callSetDisabledState??gd}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=Gt({type:n});static \u0275inj=$t({imports:[cD]})}return n})(),yd=(()=>{class n{static withConfig(t){return{ngModule:n,providers:[{provide:rD,useValue:t.warnOnNgModelWithFormControl??"always"},{provide:Va,useValue:t.callSetDisabledState??gd}]}}static \u0275fac=function(i){return new(i||n)};static \u0275mod=Gt({type:n});static \u0275inj=$t({imports:[cD]})}return n})();var zO=(n,e,t,i)=>({"placeholder-inputPlaceholder":n,floated:e,"border-error":t,"border-inputBorder":i}),WO=(n,e,t,i)=>({"text-inputPlaceholderFloated":n,"text-inputPlaceholder":e,"left-[22px]":t,"right-[22px]":i});function GO(n,e){n&1&&(k(0,"i",3),ve(1,"*"),N())}var wd=class n{control;field;valueChange=new oe;isFocused=!1;isTouched=!1;langService=T(wt);onInputChange(e=""){this.valueChange.emit(e)}onFocus(){this.isFocused=this.isTouched=!0}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ye({type:n,selectors:[["dvs-text-field"]],inputs:{control:"control",field:"field"},outputs:{valueChange:"valueChange"},decls:6,vars:17,consts:[[1,"text-field"],["type","text",1,"w-full","pb-2","px-[22px]","min-h-[70px]","pt-9","rounded-xl","focus:outline-none","text-lg","text-inputText","border","bg-inputBg",3,"ngModelChange","focus","blur","ngClass","ngModel","formControl"],[3,"ngClass"],[1,"mx-1","text-error"]],template:function(t,i){t&1&&(k(0,"div",0)(1,"input",1),Er("ngModelChange",function(s){return Ss(i.field.value,s)||(i.field.value=s),s}),me("ngModelChange",function(){return i.onInputChange(i.field.value)})("focus",function(){return i.onFocus()})("blur",function(){return i.isFocused=!1}),N(),k(2,"label",2)(3,"span"),ve(4),N(),Re(5,GO,2,0,"i",3),N()()),t&2&&(V(),W("ngClass",qo(7,zO,!i.field.value,i.field.value||i.isFocused,i.control.invalid&&!i.field.value&&i.control.touched,!(i.field.required&&!i.field.value&&i.control.touched))),_r("ngModel",i.field.value),W("formControl",i.control),Ds("required",i.field.required),V(),W("ngClass",qo(12,WO,i.field.value||i.isFocused,!i.field.value,i.langService.isLTR(),i.langService.isRTL())),V(2),Oe(i.field.label),V(),ut(i.field.required?5:-1))},dependencies:[lt,qt,$i,Qs,Js,yd,Ym],styles:[".text-field[_ngcontent-%COMP%]{position:relative}.text-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus + label[_ngcontent-%COMP%], .text-field[_ngcontent-%COMP%] input.floated[_ngcontent-%COMP%] + label[_ngcontent-%COMP%]{top:12px;font-size:14px}.text-field[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{position:absolute;top:21px;pointer-events:none;transition:.1s;font-size:18px}"]})};var qO=n=>({rtl:n}),YO=(n,e)=>({"left-[22px]":n,"right-[22px]":e}),XO=(n,e,t,i,r)=>({"text-inputPlaceholderFloated":n,"text-inputPlaceholder":e,"has-value":t,"left-[22px]":i,"right-[22px]":r});function KO(n,e){if(n&1&&(k(0,"option",7),ve(1),N()),n&2){let t=e.$implicit;W("value",t.code),V(),Oe(t.desc)}}function ZO(n,e){n&1&&(k(0,"i",6),ve(1,"*"),N())}var _d=class n{control;field;valueChange=new oe;langService=T(wt);selectedOption;onSelectionChange(e){this.control.setValue(this.selectedOption),this.valueChange.emit(this.selectedOption)}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ye({type:n,selectors:[["dvs-dropdown-field"]],inputs:{control:"control",field:"field"},outputs:{valueChange:"valueChange"},decls:11,vars:23,consts:[[1,"dropdown-field","relative",3,"ngClass"],[1,"w-full","pb-2","px-[22px]","min-h-[70px]","pt-9","rounded-xl","focus:outline-none","text-lg","text-inputText","border","bg-inputBg","border-inputBorder","appearance-none",3,"ngModelChange","change","ngModel","disabled"],["disabled",""],[3,"value",4,"ngFor","ngForOf"],[1,"absolute","top-1/2","transform","-translate-y-1/2","text-2xl","icon","icon-down","pointer-events-none",3,"ngClass"],[3,"ngClass"],[1,"mx-1","text-error"],[3,"value"]],template:function(t,i){t&1&&(k(0,"div",0)(1,"select",1),Er("ngModelChange",function(s){return Ss(i.selectedOption,s)||(i.selectedOption=s),s}),me("change",function(s){return i.onSelectionChange(s)}),k(2,"option",2),ve(3),dt(4,"translate"),N(),Re(5,KO,2,2,"option",3),N(),fe(6,"i",4),k(7,"label",5)(8,"span"),ve(9),N(),Re(10,ZO,2,0,"i",6),N()()),t&2&&(W("ngClass",Jc(12,qO,i.langService.isRTL())),V(),_r("ngModel",i.selectedOption),W("disabled",!(i.field.options!=null&&i.field.options.length)),Ds("required",i.field.required),V(2),Oe(ht(4,10,"search.form.labels.select")),V(2),W("ngForOf",i.field.options),V(),W("ngClass",xs(14,YO,i.langService.isRTL(),i.langService.isLTR())),V(),W("ngClass",OE(17,XO,i.selectedOption,!i.field.value,i.selectedOption,i.langService.isLTR(),i.langService.isRTL())),V(2),Oe(i.field.label),V(),ut(i.field.required?10:-1))},dependencies:[lt,qt,Ts,$i,oD,lD,vd,Js,ja,un],styles:[".dropdown-field[_ngcontent-%COMP%]{position:relative}.dropdown-field[_ngcontent-%COMP%] select[_ngcontent-%COMP%]{appearance:none}.dropdown-field[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{position:absolute;top:21px;pointer-events:none;transition:.1s;font-size:18px}.dropdown-field[_ngcontent-%COMP%] label.has-value[_ngcontent-%COMP%]{top:12px;font-size:14px}"]})};var QO=(n,e,t)=>({"placeholder-inputPlaceholder":n,"border-error":e,"border-inputBorder":t}),JO=(n,e,t,i)=>({"text-inputPlaceholder":n,"floated text-inputPlaceholderFloated":e,"left-[22px]":t,"right-[22px]":i}),uD=(n,e)=>({"icon-left":n,"icon-right":e}),eL=(n,e)=>({"bg-secondaryColor text-white":n,"text-primaryColor hover:text-white hover:bg-secondaryColor hover:opacity-50":e});function tL(n,e){n&1&&(k(0,"i",6),ve(1,"*"),N())}function nL(n,e){if(n&1){let t=yn();k(0,"div",23),me("click",function(){let r=St(t).index,s=ue(3);return xt(s.selectMonth(r))}),ve(1),N()}if(n&2){let t=e.$implicit;V(),bn(" ",t," ")}}function iL(n,e){if(n&1&&(k(0,"div",21),Re(1,nL,2,1,"div",22),N()),n&2){let t=ue(2);V(),W("ngForOf",t.monthNames)}}function rL(n,e){if(n&1){let t=yn();k(0,"div",23),me("click",function(){let r=St(t).$implicit,s=ue(3);return xt(s.selectYear(r))}),ve(1),N()}if(n&2){let t=e.$implicit;V(),bn(" ",t," ")}}function sL(n,e){if(n&1&&(k(0,"div",24),Re(1,rL,2,1,"div",22),N()),n&2){let t=ue(2);V(),W("ngForOf",t.availableYears)}}function oL(n,e){if(n&1&&(k(0,"div",25)(1,"div",26)(2,"div",27),ve(3),N()()()),n&2){let t=e.$implicit;V(3),bn(" ",t," ")}}function aL(n,e){n&1&&(k(0,"div"),fe(1,"div",28),N())}function lL(n,e){if(n&1){let t=yn();k(0,"div",29)(1,"div",30)(2,"button",31),me("click",function(){let r=St(t).$implicit,s=ue(2);return xt(s.getDateValue(r))}),ve(3),N()()()}if(n&2){let t=e.$implicit,i=ue(2);V(2),W("ngClass",xs(2,eL,i.isSelectedDate(t),!i.isToday(t))),V(),bn(" ",t," ")}}function cL(n,e){if(n&1){let t=yn();k(0,"div",8)(1,"div",9)(2,"div")(3,"span",10),me("click",function(){St(t);let r=ue();return xt(r.toggleMonthDropdown())}),ve(4),N(),k(5,"span",11),me("click",function(){St(t);let r=ue();return xt(r.toggleYearDropdown())}),ve(6),N(),Re(7,iL,2,1,"div",12)(8,sL,2,1,"div",13),N(),k(9,"div")(10,"button",14),me("click",function(){St(t);let r=ue();return xt(r.previousMonth())}),fe(11,"i",15),N(),k(12,"button",14),me("click",function(){St(t);let r=ue();return xt(r.nextMonth())}),fe(13,"i",15),N()()(),k(14,"div",16),Re(15,oL,4,1,"div",17),N(),k(16,"div",18),Re(17,aL,2,0,"div",19)(18,lL,4,5,"div",20),N()()}if(n&2){let t=ue();W("ngClass",t.isRtl?"right-0 left-auto":"left-0 right-auto"),V(4),bn(" ",t.monthNames[t.month]," "),V(2),bn(" ",t.year," "),V(),W("ngIf",t.showMonthDropdown),V(),W("ngIf",t.showYearDropdown),V(3),W("ngClass",xs(10,uD,!t.isRtl,t.isRtl)),V(2),W("ngClass",xs(13,uD,t.isRtl,!t.isRtl)),V(2),W("ngForOf",t.daysNames),V(2),W("ngForOf",t.blankdays),V(),W("ngForOf",t.numOfDays)}}var Ed=class n{constructor(e,t){this.langService=e;this.datePipe=t;this.langService.onLangChange.subscribe(i=>{this.currentLang=i,this.isRtl=this.langService.isRTL()}),this.generateYears()}field;control;dateFormat="dd/MM/yyyy";valueChange=new oe;currentLang="en";isRtl=this.currentLang!=="en";isTouched=!1;MONTH_NAMES={en:["January","February","March","April","May","June","July","August","September","October","November","December"],ar:["\u064A\u0646\u0627\u064A\u0631","\u0641\u0628\u0631\u0627\u064A\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064A\u0644","\u0645\u0627\u064A\u0648","\u064A\u0648\u0646\u064A\u0648","\u064A\u0648\u0644\u064A\u0648","\u0623\u063A\u0633\u0637\u0633","\u0633\u0628\u062A\u0645\u0628\u0631","\u0623\u0643\u062A\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062F\u064A\u0633\u0645\u0628\u0631"]};DAYS={en:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ar:["\u0627\u0644\u0623\u062D\u062F","\u0627\u0644\u0625\u062B\u0646\u064A\u0646","\u0627\u0644\u062B\u0644\u0627\u062B\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062E\u0645\u064A\u0633","\u0627\u0644\u062C\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062A"]};showDatepicker=!1;showMonthDropdown=!1;showYearDropdown=!1;datepickerValue="";month=0;year=0;numOfDays=[];blankdays=[];langChangeSubscription;selectedDate;availableYears=[];ngOnInit(){this.initDate()}initDate(){let e=new Date;this.month=e.getMonth(),this.year=e.getFullYear(),this.getNoOfDays()}generateYears(){let e=new Date().getFullYear();for(let t=e+50;t>=e-50;t--)this.availableYears.push(t)}toggleMonthDropdown(){this.showMonthDropdown=!this.showMonthDropdown,this.showYearDropdown=!1}toggleYearDropdown(){this.showYearDropdown=!this.showYearDropdown,this.showMonthDropdown=!1}selectMonth(e){this.month=e,this.showMonthDropdown=!1,this.getNoOfDays()}selectYear(e){this.year=e,this.showYearDropdown=!1,this.getNoOfDays()}onDateChange(e=""){this.valueChange.emit(e)}isToday(e){let t=new Date,i=new Date(this.year,this.month,e);return t.toDateString()===i.toDateString()}getDateValue(e){this.selectedDate=new Date(this.year,this.month,e),this.datepickerValue=this.datePipe.transform(this.selectedDate,this.dateFormat),this.control.setValue(this.datepickerValue),this.field.value=this.datepickerValue,this.onDateChange(this.field.value),this.showDatepicker=!1}getNoOfDays(){let e=new Date(this.year,this.month+1,0).getDate(),t=new Date(this.year,this.month).getDay();this.blankdays=Array.from({length:t},(i,r)=>r+1),this.numOfDays=Array.from({length:e},(i,r)=>r+1)}onDateInputClick(){this.showDatepicker=!this.showDatepicker,this.showDatepicker||(this.isTouched=!0)}previousMonth(){this.month===0?(this.month=11,this.year--):this.month--,this.getNoOfDays()}nextMonth(){this.month===11?(this.month=0,this.year++):this.month++,this.getNoOfDays()}get daysNames(){return this.currentLang==="en"?this.DAYS.en:this.DAYS.ar}get monthNames(){return this.currentLang==="en"?this.MONTH_NAMES.en:this.MONTH_NAMES.ar}isSelectedDate(e){return this.selectedDate?this.selectedDate.toDateString()===new Date(this.year,this.month,e).toDateString():this.isToday(e)}static \u0275fac=function(t){return new(t||n)(j(wt),j(Jo))};static \u0275cmp=ye({type:n,selectors:[["dvs-date-field"]],inputs:{field:"field",control:"control",dateFormat:"dateFormat"},outputs:{valueChange:"valueChange"},features:[ai([Jo])],decls:10,vars:16,consts:[[1,"date-field","relative","container","cursor-pointer"],["type","hidden","name","date"],["type","text","readonly","",1,"w-full","min-h-[70px]","pt-[24px]","px-[22px]","rounded-xl","focus:outline-none","text-lg","text-inputText","border","bg-inputBg","cursor-pointer",3,"ngModelChange","click","ngModel","ngClass"],[1,"absolute","top-[24px]",3,"click","ngClass"],[1,"icon","icon-calendar","text-3xl"],[1,"date-label",3,"ngClass"],[1,"mx-1","text-error"],["class","bg-white rounded-lg shadow absolute top-[70px] w-[22rem] p-2",3,"ngClass",4,"ngIf"],[1,"bg-white","rounded-lg","shadow","absolute","top-[70px]","w-[22rem]","p-2",3,"ngClass"],[1,"flex","justify-between","items-center","mb-2"],[1,"text-lg","font-bold","text-primaryColor","cursor-pointer",3,"click"],[1,"ml-1","text-lg","text-primaryColor","font-normal","cursor-pointer",3,"click"],["class","absolute bg-white shadow-md rounded p-2 mt-1 z-10 w-32",4,"ngIf"],["class","absolute bg-white shadow-md rounded p-2 mt-1 z-10 w-24 h-[350px] overflow-y-auto",4,"ngIf"],["type","button",1,"transition","ease-in-out","duration-100","inline-flex","cursor-pointer","hover:bg-gray-200","p-1","rounded-full","min-w-[30px]","min-h-[30px]","items-center","justify-center",3,"click"],[1,"icon","text-xl","text-primaryColor","inline-flex",3,"ngClass"],[1,"mb-3","-mx-1","grid","grid-cols-7"],["class","",4,"ngFor","ngForOf"],[1,"-mx-1","grid","grid-cols-7"],[4,"ngFor","ngForOf"],["class","grid grid-cols-7",4,"ngFor","ngForOf"],[1,"absolute","bg-white","shadow-md","rounded","p-2","mt-1","z-10","w-32"],["class","cursor-pointer p-1 hover:bg-gray-200",3,"click",4,"ngFor","ngForOf"],[1,"cursor-pointer","p-1","hover:bg-gray-200",3,"click"],[1,"absolute","bg-white","shadow-md","rounded","p-2","mt-1","z-10","w-24","h-[350px]","overflow-y-auto"],[1,""],[1,"px-1"],[1,"text-primaryColor","font-medium","text-center","text-xs"],[1,"text-center","border","p-1","border-transparent","text-sm"],[1,"grid","grid-cols-7"],[1,"px-1","mb-1"],[1,"self-center","text-center","text-sm","leading-none","rounded-full","transition","ease-in-out","duration-100","w-[20px]","h-[20px]",3,"click","ngClass"]],template:function(t,i){t&1&&(k(0,"div",0),fe(1,"input",1),k(2,"input",2),Er("ngModelChange",function(s){return Ss(i.datepickerValue,s)||(i.datepickerValue=s),s}),me("click",function(){return i.onDateInputClick()}),N(),k(3,"div",3),me("click",function(){return i.onDateInputClick()}),fe(4,"i",4),N(),k(5,"label",5)(6,"span"),ve(7),N(),Re(8,tL,2,0,"i",6),N(),Re(9,cL,19,16,"div",7),N()),t&2&&(V(2),_r("ngModel",i.datepickerValue),W("ngClass",kE(7,QO,!i.field.value,i.control.invalid&&!i.field.value&&i.isTouched,!(i.field.required&&!i.field.value&&i.isTouched))),V(),W("ngClass",i.isRtl?"left-[22px] right-auto":"right-[22px] left-auto"),V(2),W("ngClass",qo(11,JO,!(i.field.value||i.showDatepicker),i.field.value||i.showDatepicker,!i.isRtl,i.isRtl)),V(2),Oe(i.field.label),V(),ut(i.field.required?8:-1),V(),W("ngIf",i.showDatepicker))},dependencies:[lt,qt,Ts,jg,$i,Qs,Js,ja],styles:[".date-field[_ngcontent-%COMP%]{position:relative}.date-field[_ngcontent-%COMP%] .date-label[_ngcontent-%COMP%]{position:absolute;left:22px;top:21px;pointer-events:none;transition:.1s;font-size:18px}.date-field[_ngcontent-%COMP%] .date-label.floated[_ngcontent-%COMP%]{top:12px;font-size:14px}"]})};function uL(n,e){if(n&1){let t=yn();k(0,"div",2)(1,"dvs-text-field",3),me("valueChange",function(r){St(t);let s=ue(2).$implicit,o=ue(2);return xt(o.onValuesChange(r,s.index))}),N()()}if(n&2){let t=ue(2).$implicit,i=ue(2);V(),W("control",i.getFormControl(t.index))("field",t)}}function dL(n,e){if(n&1){let t=yn();k(0,"div",2)(1,"dvs-dropdown-field",3),me("valueChange",function(r){St(t);let s=ue(2).$implicit,o=ue(2);return xt(o.onValuesChange(r,s.index))}),N()()}if(n&2){let t=ue(2).$implicit,i=ue(2);V(),W("control",i.getFormControl(t.index))("field",t)}}function hL(n,e){if(n&1){let t=yn();k(0,"div",2)(1,"dvs-date-field",3),me("valueChange",function(r){St(t);let s=ue(2).$implicit,o=ue(2);return xt(o.onValuesChange(r,s.index))}),N()()}if(n&2){let t=ue(2).$implicit,i=ue(2);V(),W("control",i.getFormControl(t.index))("field",t)}}function fL(n,e){if(n&1&&Re(0,uL,2,2,"div",2)(1,dL,2,2,"div",2)(2,hL,2,2,"div",2),n&2){let t=ue().$implicit;ut(t.type==="text"?0:t.type==="dropdown"?1:t.type==="date"?2:-1)}}function pL(n,e){if(n&1&&Re(0,fL,3,1),n&2){let t=e.$implicit;ut(t.index?0:-1)}}function gL(n,e){if(n&1&&(k(0,"div",0)(1,"form",1),IE(2,pL,1,1,null,null,xE),N()()),n&2){let t=ue();V(),W("formGroup",t.dynamicForm),V(),TE(t.fields())}}var Ba=class n{dynamicForm;fields=Cs();onAnyChange=c0();emitOnChange=Cs(!0);reset=Cs(!1);constructor(){this.dynamicForm||(this.dynamicForm=new cd({})),ki(()=>{this.removeOldDynamicFields(),this.fields()?.forEach(e=>{let t=[];e.required&&t.push(id.required),e.index&&this.dynamicForm.addControl(e.index,new md("",t))})}),ki(()=>{this.reset()&&this.resetForm()})}getFormControl(e){return this.dynamicForm.get(e)}onValuesChange(e,t){this.emitOnChange()&&this.onAnyChange.emit({value:e,index:t,isValidForm:this.checkValidity()})}checkValidity(){for(let e of Object.keys(this.dynamicForm.controls))if(this.dynamicForm.controls[e].errors)return!1;return!0}resetForm(){for(let e of this.fields()||[])this.getFormControl(e?.index||"")?.reset()}removeOldDynamicFields(){let e={};for(let t of Object.keys(this.dynamicForm.controls))(t==="serviceType"||t==="certificationType")&&(e[t]=this.dynamicForm.controls[t]);this.dynamicForm.controls=e}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ye({type:n,selectors:[["dvs-dynamic-form"]],inputs:{fields:[1,"fields"],emitOnChange:[1,"emitOnChange"],reset:[1,"reset"]},outputs:{onAnyChange:"onAnyChange"},decls:1,vars:1,consts:[[1,"container"],[3,"formGroup"],[1,"mb-8"],[3,"valueChange","control","field"]],template:function(t,i){t&1&&Re(0,gL,4,1,"div",0),t&2&&ut(i.dynamicForm?0:-1)},dependencies:[lt,$i,iD,ZA,wd,yd,Xm,_d,Ed],encapsulation:2})};var Cd=class n{type="ERROR";message="";iconName=this.type.toLowerCase();static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ye({type:n,selectors:[["dvs-alert-message"]],inputs:{type:"type",message:"message"},decls:4,vars:2,consts:[[1,"alert-wrapper","w-full","border","border-errorLight","bg-errorLight","text-error","text-l","min-h-20","rounded-xl","flex","items-center","py-3","px-5","font-bold"],[1,"icon","me-3","text-3xl","font-bold",3,"ngClass"]],template:function(t,i){t&1&&(k(0,"div",0),fe(1,"span",1),k(2,"span"),ve(3),N()()),t&2&&(V(),W("ngClass","icon-"+i.iconName),V(2),Oe(i.message))},dependencies:[lt,qt],encapsulation:2})};var zi=class n{themeSignal=ze("dark");theme$=Ar(()=>this.themeSignal());init(){let e=localStorage.getItem("app-theme");e?this.setTheme(e):this.setTheme(this.getTheme())}getTheme(){return this.themeSignal()}setTheme(e){let t=this.getTheme();this.themeSignal.set(e),this.applyTheme(e,t)}applyTheme(e,t){document.body?.setAttribute("data-theme",e),localStorage.setItem("app-theme",e)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})};var ro={};Sb(ro,{AbortException:()=>pF,AnnotationEditorLayer:()=>gF,AnnotationEditorParamsType:()=>mF,AnnotationEditorType:()=>Sy,AnnotationEditorUIManager:()=>vF,AnnotationLayer:()=>yF,AnnotationMode:()=>bF,ColorPicker:()=>wF,DOMSVGFactory:()=>_F,DrawLayer:()=>EF,FeatureTest:()=>CF,GlobalWorkerOptions:()=>xy,ImageKind:()=>AF,InvalidPDFException:()=>DF,MissingPDFException:()=>SF,OPS:()=>xF,OutputScale:()=>IF,PDFDataRangeTransport:()=>TF,PDFDateString:()=>MF,PDFWorker:()=>RF,PasswordResponses:()=>PF,PermissionFlag:()=>NF,PixelsPerInch:()=>kF,RenderingCancelledException:()=>OF,TextLayer:()=>LF,UnexpectedResponseException:()=>FF,Util:()=>VF,VerbosityLevel:()=>Iy,XfaLayer:()=>jF,build:()=>BF,createValidAbsoluteUrl:()=>UF,fetchData:()=>HF,getDocument:()=>Ty,getFilenameFromUrl:()=>$F,getPdfFilenameFromUrl:()=>zF,getXfaPageViewport:()=>WF,isDataScheme:()=>GF,isPdfFile:()=>qF,noContextMenu:()=>YF,normalizeUnicode:()=>XF,setLayerDimensions:()=>KF,shadow:()=>ZF,version:()=>al});var Wa={};Wa.d=(n,e)=>{for(var t in e)Wa.o(e,t)&&!Wa.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})};Wa.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var X=globalThis.pdfjsLib={};Wa.d(X,{AbortException:()=>_i,AnnotationEditorLayer:()=>fF,AnnotationEditorParamsType:()=>q,AnnotationEditorType:()=>te,AnnotationEditorUIManager:()=>Za,AnnotationLayer:()=>hy,AnnotationMode:()=>Wi,ColorPicker:()=>ch,DOMSVGFactory:()=>nl,DrawLayer:()=>yy,FeatureTest:()=>pt,GlobalWorkerOptions:()=>Or,ImageKind:()=>Md,InvalidPDFException:()=>Nd,MissingPDFException:()=>wi,OPS:()=>An,OutputScale:()=>Ka,PDFDataRangeTransport:()=>Xd,PDFDateString:()=>Od,PDFWorker:()=>no,PasswordResponses:()=>_L,PermissionFlag:()=>wL,PixelsPerInch:()=>Gi,RenderingCancelledException:()=>Xa,TextLayer:()=>el,UnexpectedResponseException:()=>io,Util:()=>B,VerbosityLevel:()=>dh,XfaLayer:()=>Qd,build:()=>dF,createValidAbsoluteUrl:()=>DL,fetchData:()=>gh,getDocument:()=>aF,getFilenameFromUrl:()=>NL,getPdfFilenameFromUrl:()=>kL,getXfaPageViewport:()=>OL,isDataScheme:()=>mh,isPdfFile:()=>_y,noContextMenu:()=>hn,normalizeUnicode:()=>ML,setLayerDimensions:()=>Lr,shadow:()=>de,version:()=>uF});var Et=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),xD=[1,0,0,1,0,0],tv=[.001,0,0,.001,0,0],vL=1e7,Td=1.35,yL=.35,X5=yL/Td,Qt={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Wi={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},bL="pdfjs_internal_editor_",te={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15},q={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_DEFAULT_COLOR:32,HIGHLIGHT_THICKNESS:33,HIGHLIGHT_FREE:34,HIGHLIGHT_SHOW_ALL:35},wL={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},_t={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},Md={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},nt={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26};var Ua={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5};var dh={ERRORS:0,WARNINGS:1,INFOS:5},An={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93},_L={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},hh=dh.WARNINGS;function EL(n){Number.isInteger(n)&&(hh=n)}function CL(){return hh}function fh(n){hh>=dh.INFOS&&console.log(`Info: ${n}`)}function ie(n){hh>=dh.WARNINGS&&console.log(`Warning: ${n}`)}function Pe(n){throw new Error(n)}function it(n,e){n||Pe(e)}function AL(n){switch(n?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function DL(n,e=null,t=null){if(!n)return null;try{if(t&&typeof n=="string"&&(t.addDefaultProtocol&&n.startsWith("www.")&&n.match(/\./g)?.length>=2&&(n=`http://${n}`),t.tryConvertEncoding))try{n=TL(n)}catch{}let i=e?new URL(n,e):new URL(n);if(AL(i))return i}catch{}return null}function de(n,e,t,i=!1){return Object.defineProperty(n,e,{value:t,enumerable:!i,configurable:!0,writable:!1}),t}var qi=function(){function e(t,i){this.message=t,this.name=i}return e.prototype=new Error,e.constructor=e,e}(),Ga=class extends qi{constructor(e,t){super(e,"PasswordException"),this.code=t}},qa=class extends qi{constructor(e,t){super(e,"UnknownErrorException"),this.details=t}},Nd=class extends qi{constructor(e){super(e,"InvalidPDFException")}},wi=class extends qi{constructor(e){super(e,"MissingPDFException")}},io=class extends qi{constructor(e,t){super(e,"UnexpectedResponseException"),this.status=t}},nv=class extends qi{constructor(e){super(e,"FormatError")}},_i=class extends qi{constructor(e){super(e,"AbortException")}};function ID(n){(typeof n!="object"||n?.length===void 0)&&Pe("Invalid argument for bytesToString");let e=n.length,t=8192;if(e>24&255,n>>16&255,n>>8&255,n&255)}function by(n){let e=Object.create(null);for(let[t,i]of n)e[t]=i;return e}function xL(){let n=new Uint8Array(4);return n[0]=1,new Uint32Array(n.buffer,0,1)[0]===1}function IL(){try{return new Function(""),!0}catch{return!1}}var pt=class{static get isLittleEndian(){return de(this,"isLittleEndian",xL())}static get isEvalSupported(){return de(this,"isEvalSupported",IL())}static get isOffscreenCanvasSupported(){return de(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get platform(){return typeof navigator<"u"&&typeof navigator?.platform=="string"?de(this,"platform",{isMac:navigator.platform.includes("Mac"),isWindows:navigator.platform.includes("Win"),isFirefox:typeof navigator?.userAgent=="string"&&navigator.userAgent.includes("Firefox")}):de(this,"platform",{isMac:!1,isWindows:!1,isFirefox:!1})}static get isCSSRoundSupported(){return de(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}},Km=Array.from(Array(256).keys(),n=>n.toString(16).padStart(2,"0")),B=class{static makeHexColor(e,t,i){return`#${Km[e]}${Km[t]}${Km[i]}`}static scaleMinMax(e,t){let i;e[0]?(e[0]<0&&(i=t[0],t[0]=t[2],t[2]=i),t[0]*=e[0],t[2]*=e[0],e[3]<0&&(i=t[1],t[1]=t[3],t[3]=i),t[1]*=e[3],t[3]*=e[3]):(i=t[0],t[0]=t[1],t[1]=i,i=t[2],t[2]=t[3],t[3]=i,e[1]<0&&(i=t[1],t[1]=t[3],t[3]=i),t[1]*=e[1],t[3]*=e[1],e[2]<0&&(i=t[0],t[0]=t[2],t[2]=i),t[0]*=e[2],t[2]*=e[2]),t[0]+=e[4],t[1]+=e[5],t[2]+=e[4],t[3]+=e[5]}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static applyTransform(e,t){let i=e[0]*t[0]+e[1]*t[2]+t[4],r=e[0]*t[1]+e[1]*t[3]+t[5];return[i,r]}static applyInverseTransform(e,t){let i=t[0]*t[3]-t[1]*t[2],r=(e[0]*t[3]-e[1]*t[2]+t[2]*t[5]-t[4]*t[3])/i,s=(-e[0]*t[1]+e[1]*t[0]+t[4]*t[1]-t[5]*t[0])/i;return[r,s]}static getAxialAlignedBoundingBox(e,t){let i=this.applyTransform(e,t),r=this.applyTransform(e.slice(2,4),t),s=this.applyTransform([e[0],e[3]],t),o=this.applyTransform([e[2],e[1]],t);return[Math.min(i[0],r[0],s[0],o[0]),Math.min(i[1],r[1],s[1],o[1]),Math.max(i[0],r[0],s[0],o[0]),Math.max(i[1],r[1],s[1],o[1])]}static inverseTransform(e){let t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e){let t=[e[0],e[2],e[1],e[3]],i=e[0]*t[0]+e[1]*t[2],r=e[0]*t[1]+e[1]*t[3],s=e[2]*t[0]+e[3]*t[2],o=e[2]*t[1]+e[3]*t[3],a=(i+o)/2,l=Math.sqrt((i+o)**2-4*(i*o-s*r))/2,c=a+l||1,u=a-l||1;return[Math.sqrt(c),Math.sqrt(u)]}static normalizeRect(e){let t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){let i=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(i>r)return null;let s=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),o=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return s>o?null:[i,s,r,o]}static#e(e,t,i,r,s,o,a,l,c,u){if(c<=0||c>=1)return;let d=1-c,h=c*c,f=h*c,p=d*(d*(d*e+3*c*t)+3*h*i)+f*r,g=d*(d*(d*s+3*c*o)+3*h*a)+f*l;u[0]=Math.min(u[0],p),u[1]=Math.min(u[1],g),u[2]=Math.max(u[2],p),u[3]=Math.max(u[3],g)}static#t(e,t,i,r,s,o,a,l,c,u,d,h){if(Math.abs(c)<1e-12){Math.abs(u)>=1e-12&&this.#e(e,t,i,r,s,o,a,l,-d/u,h);return}let f=u**2-4*d*c;if(f<0)return;let p=Math.sqrt(f),g=2*c;this.#e(e,t,i,r,s,o,a,l,(-u+p)/g,h),this.#e(e,t,i,r,s,o,a,l,(-u-p)/g,h)}static bezierBoundingBox(e,t,i,r,s,o,a,l,c){return c?(c[0]=Math.min(c[0],e,a),c[1]=Math.min(c[1],t,l),c[2]=Math.max(c[2],e,a),c[3]=Math.max(c[3],t,l)):c=[Math.min(e,a),Math.min(t,l),Math.max(e,a),Math.max(t,l)],this.#t(e,i,s,a,t,r,o,l,3*(-e+3*(i-s)+a),6*(e-2*i+s),3*(i-e),c),this.#t(e,i,s,a,t,r,o,l,3*(-t+3*(r-o)+l),6*(t-2*r+o),3*(r-t),c),c}};function TL(n){return decodeURIComponent(escape(n))}var Zm=null,hD=null;function ML(n){return Zm||(Zm=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,hD=new Map([["\uFB05","\u017Ft"]])),n.replaceAll(Zm,(e,t,i)=>t?t.normalize("NFKC"):hD.get(i))}function RL(){if(typeof crypto<"u"&&typeof crypto?.randomUUID=="function")return crypto.randomUUID();let n=new Uint8Array(32);if(typeof crypto<"u"&&typeof crypto?.getRandomValues=="function")crypto.getRandomValues(n);else for(let e=0;e<32;e++)n[e]=Math.floor(Math.random()*255);return ID(n)}var wy="pdfjs_internal_id_",mi={BEZIER_CURVE_TO:0,MOVE_TO:1,LINE_TO:2,QUADRATIC_CURVE_TO:3,RESTORE:4,SAVE:5,SCALE:6,TRANSFORM:7,TRANSLATE:8};function PL(n){return Uint8Array.prototype.toBase64?n.toBase64():btoa(ID(n))}var yi="http://www.w3.org/2000/svg",Gi=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF};function gh(n,e="text"){return A(this,null,function*(){if(za(n,document.baseURI)){let t=yield fetch(n);if(!t.ok)throw new Error(t.statusText);switch(e){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"json":return t.json()}return t.text()}return new Promise((t,i)=>{let r=new XMLHttpRequest;r.open("GET",n,!0),r.responseType=e,r.onreadystatechange=()=>{if(r.readyState===XMLHttpRequest.DONE){if(r.status===200||r.status===0){switch(e){case"arraybuffer":case"blob":case"json":t(r.response);return}t(r.responseText);return}i(new Error(r.statusText))}},r.send(null)})})}var Ya=class n{constructor({viewBox:e,scale:t,rotation:i,offsetX:r=0,offsetY:s=0,dontFlip:o=!1}){this.viewBox=e,this.scale=t,this.rotation=i,this.offsetX=r,this.offsetY=s;let a=(e[2]+e[0])/2,l=(e[3]+e[1])/2,c,u,d,h;switch(i%=360,i<0&&(i+=360),i){case 180:c=-1,u=0,d=0,h=1;break;case 90:c=0,u=1,d=1,h=0;break;case 270:c=0,u=-1,d=-1,h=0;break;case 0:c=1,u=0,d=0,h=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}o&&(d=-d,h=-h);let f,p,g,v;c===0?(f=Math.abs(l-e[1])*t+r,p=Math.abs(a-e[0])*t+s,g=(e[3]-e[1])*t,v=(e[2]-e[0])*t):(f=Math.abs(a-e[0])*t+r,p=Math.abs(l-e[1])*t+s,g=(e[2]-e[0])*t,v=(e[3]-e[1])*t),this.transform=[c*t,u*t,d*t,h*t,f-c*t*a-d*t*l,p-u*t*a-h*t*l],this.width=g,this.height=v}get rawDims(){let{viewBox:e}=this;return de(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:t=this.rotation,offsetX:i=this.offsetX,offsetY:r=this.offsetY,dontFlip:s=!1}={}){return new n({viewBox:this.viewBox.slice(),scale:e,rotation:t,offsetX:i,offsetY:r,dontFlip:s})}convertToViewportPoint(e,t){return B.applyTransform([e,t],this.transform)}convertToViewportRectangle(e){let t=B.applyTransform([e[0],e[1]],this.transform),i=B.applyTransform([e[2],e[3]],this.transform);return[t[0],t[1],i[0],i[1]]}convertToPdfPoint(e,t){return B.applyInverseTransform([e,t],this.transform)}},Xa=class extends qi{constructor(e,t=0){super(e,"RenderingCancelledException"),this.extraDelay=t}};function mh(n){let e=n.length,t=0;for(;t=1&&r<=12?r-1:0;let s=parseInt(t[3],10);s=s>=1&&s<=31?s:1;let o=parseInt(t[4],10);o=o>=0&&o<=23?o:0;let a=parseInt(t[5],10);a=a>=0&&a<=59?a:0;let l=parseInt(t[6],10);l=l>=0&&l<=59?l:0;let c=t[7]||"Z",u=parseInt(t[8],10);u=u>=0&&u<=23?u:0;let d=parseInt(t[9],10)||0;return d=d>=0&&d<=59?d:0,c==="-"?(o+=u,a+=d):c==="+"&&(o-=u,a-=d),new Date(Date.UTC(i,r,s,o,a,l))}};function OL(n,{scale:e=1,rotation:t=0}){let{width:i,height:r}=n.attributes.style,s=[0,0,parseInt(i),parseInt(r)];return new Ya({viewBox:s,scale:e,rotation:t})}function Ey(n){if(n.startsWith("#")){let e=parseInt(n.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return n.startsWith("rgb(")?n.slice(4,-1).split(",").map(e=>parseInt(e)):n.startsWith("rgba(")?n.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(ie(`Not a valid color format: "${n}"`),[0,0,0])}function LL(n){let e=document.createElement("span");e.style.visibility="hidden",document.body.append(e);for(let t of n.keys()){e.style.color=t;let i=window.getComputedStyle(e).color;n.set(t,Ey(i))}e.remove()}function Le(n){let{a:e,b:t,c:i,d:r,e:s,f:o}=n.getTransform();return[e,t,i,r,s,o]}function vi(n){let{a:e,b:t,c:i,d:r,e:s,f:o}=n.getTransform().invertSelf();return[e,t,i,r,s,o]}function Lr(n,e,t=!1,i=!0){if(e instanceof Ya){let{pageWidth:r,pageHeight:s}=e.rawDims,{style:o}=n,a=pt.isCSSRoundSupported,l=`var(--scale-factor) * ${r}px`,c=`var(--scale-factor) * ${s}px`,u=a?`round(down, ${l}, var(--scale-round-x, 1px))`:`calc(${l})`,d=a?`round(down, ${c}, var(--scale-round-y, 1px))`:`calc(${c})`;!t||e.rotation%180===0?(o.width=u,o.height=d):(o.width=d,o.height=u)}i&&n.setAttribute("data-main-rotation",e.rotation)}var Ka=class{constructor(){let e=window.devicePixelRatio||1;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}},iv=class n{#e=null;#t=null;#n;#i=null;#r=null;static#s=null;constructor(e){this.#n=e,n.#s||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button"})}render(){let e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");let t=this.#n._uiManager._signal;e.addEventListener("contextmenu",hn,{signal:t}),e.addEventListener("pointerdown",n.#l,{signal:t});let i=this.#i=document.createElement("div");i.className="buttons",e.append(i);let r=this.#n.toolbarPosition;if(r){let{style:s}=e,o=this.#n._uiManager.direction==="ltr"?1-r[0]:r[0];s.insetInlineEnd=`${100*o}%`,s.top=`calc(${100*r[1]}% + var(--editor-toolbar-vert-offset))`}return this.#d(),e}get div(){return this.#e}static#l(e){e.stopPropagation()}#c(e){this.#n._focusEventsAllowed=!1,e.preventDefault(),e.stopPropagation()}#u(e){this.#n._focusEventsAllowed=!0,e.preventDefault(),e.stopPropagation()}#a(e){let t=this.#n._uiManager._signal;e.addEventListener("focusin",this.#c.bind(this),{capture:!0,signal:t}),e.addEventListener("focusout",this.#u.bind(this),{capture:!0,signal:t}),e.addEventListener("contextmenu",hn,{signal:t})}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#r?.shown()}#d(){let{editorType:e,_uiManager:t}=this.#n,i=document.createElement("button");i.className="delete",i.tabIndex=0,i.setAttribute("data-l10n-id",n.#s[e]),this.#a(i),i.addEventListener("click",r=>{t.delete()},{signal:t._signal}),this.#i.append(i)}get#o(){let e=document.createElement("div");return e.className="divider",e}addAltText(e){return A(this,null,function*(){let t=yield e.render();this.#a(t),this.#i.prepend(t,this.#o),this.#r=e})}addColorPicker(e){this.#t=e;let t=e.renderButton();this.#a(t),this.#i.prepend(t,this.#o)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}},rv=class{#e=null;#t=null;#n;constructor(e){this.#n=e}#i(){let e=this.#t=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar"),e.addEventListener("contextmenu",hn,{signal:this.#n._signal});let t=this.#e=document.createElement("div");return t.className="buttons",e.append(t),this.#s(),e}#r(e,t){let i=0,r=0;for(let s of e){let o=s.y+s.height;if(oi){r=a,i=o;continue}t?a>r&&(r=a):a{this.#n.highlightSelection("floating_button")},{signal:i}),this.#e.append(e)}};function Ld(n,e,t){for(let i of t)e.addEventListener(i,n[i].bind(n))}function FL(n){return Math.round(Math.min(255,Math.max(1,255*n))).toString(16).padStart(2,"0")}var sv=class{#e=0;get id(){return`${bL}${this.#e++}`}},ov=class n{#e=RL();#t=0;#n=null;static get _isSVGFittingCanvas(){let e='data:image/svg+xml;charset=UTF-8,',i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),r=new Image;r.src=e;let s=r.decode().then(()=>(i.drawImage(r,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return de(this,"_isSVGFittingCanvas",s)}#i(e,t){return A(this,null,function*(){this.#n||=new Map;let i=this.#n.get(e);if(i===null)return null;if(i?.bitmap)return i.refCounter+=1,i;try{i||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let r;if(typeof t=="string"?(i.url=t,r=yield gh(t,"blob")):t instanceof File?r=i.file=t:t instanceof Blob&&(r=t),r.type==="image/svg+xml"){let s=n._isSVGFittingCanvas,o=new FileReader,a=new Image,l=new Promise((c,u)=>{a.onload=()=>{i.bitmap=a,i.isSvg=!0,c()},o.onload=()=>A(this,null,function*(){let d=i.svgUrl=o.result;a.src=(yield s)?`${d}#svgView(preserveAspectRatio(none))`:d}),a.onerror=o.onerror=u});o.readAsDataURL(r),yield l}else i.bitmap=yield createImageBitmap(r);i.refCounter=1}catch(r){console.error(r),i=null}return this.#n.set(e,i),i&&this.#n.set(i.id,i),i})}getFromFile(e){return A(this,null,function*(){let{lastModified:t,name:i,size:r,type:s}=e;return this.#i(`${t}_${i}_${r}_${s}`,e)})}getFromUrl(e){return A(this,null,function*(){return this.#i(e,e)})}getFromBlob(e,t){return A(this,null,function*(){let i=yield t;return this.#i(e,i)})}getFromId(e){return A(this,null,function*(){this.#n||=new Map;let t=this.#n.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){let{blobPromise:i}=t;return delete t.blobPromise,this.getFromBlob(t.id,i)}return this.getFromUrl(t.url)})}getFromCanvas(e,t){this.#n||=new Map;let i=this.#n.get(e);if(i?.bitmap)return i.refCounter+=1,i;let r=new OffscreenCanvas(t.width,t.height);return r.getContext("2d").drawImage(t,0,0),i={bitmap:r.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#n.set(e,i),this.#n.set(i.id,i),i}getSvgUrl(e){let t=this.#n.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t||(t.refCounter-=1,t.refCounter!==0))return;let{bitmap:i}=t;if(!t.url&&!t.file){let r=new OffscreenCanvas(i.width,i.height);r.getContext("bitmaprenderer").transferFromImageBitmap(i),t.blobPromise=r.convertToBlob()}i.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}},av=class{#e=[];#t=!1;#n;#i=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:t,post:i,mustExec:r,type:s=NaN,overwriteIfSameType:o=!1,keepUndo:a=!1}){if(r&&e(),this.#t)return;let l={cmd:e,undo:t,post:i,type:s};if(this.#i===-1){this.#e.length>0&&(this.#e.length=0),this.#i=0,this.#e.push(l);return}if(o&&this.#e[this.#i].type===s){a&&(l.undo=this.#e[this.#i].undo),this.#e[this.#i]=l;return}let c=this.#i+1;c===this.#n?this.#e.splice(0,1):(this.#i=c,cs===t[o]))return n._colorsMapping.get(i);return t}getHexCode(e){let t=this._colors.get(e);return t?B.makeHexColor(...t):e}},Za=(()=>{class n{#e=new AbortController;#t=null;#n=new Map;#i=new Map;#r=null;#s=null;#l=null;#c=new av;#u=null;#a=0;#d=new Set;#o=null;#h=null;#p=new Set;#f=!1;#g=!1;#v=!1;#m=null;#y=null;#w=null;#C=null;#_=!1;#E=null;#M=new sv;#x=!1;#A=!1;#I=null;#S=null;#R=null;#N=null;#D=te.NONE;#b=new Set;#T=null;#P=null;#F=null;#U={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#B=[0,0];#L=null;#V=null;#j=null;#k=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=n.prototype,i=a=>a.#V.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&a.hasSomethingToControl(),r=(a,{target:l})=>{if(l instanceof HTMLInputElement){let{type:c}=l;return c!=="text"&&c!=="number"}return!0},s=this.TRANSLATE_SMALL,o=this.TRANSLATE_BIG;return de(this,"_keyboardManager",new Fr([[["ctrl+a","mac+meta+a"],t.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],t.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],t.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],t.delete,{checker:r}],[["Enter","mac+Enter"],t.addNewEditorFromKeyboard,{checker:(a,{target:l})=>!(l instanceof HTMLButtonElement)&&a.#V.contains(l)&&!a.isEnterHandled}],[[" ","mac+ "],t.addNewEditorFromKeyboard,{checker:(a,{target:l})=>!(l instanceof HTMLButtonElement)&&a.#V.contains(document.activeElement)}],[["Escape","mac+Escape"],t.unselectAll],[["ArrowLeft","mac+ArrowLeft"],t.translateSelectedEditors,{args:[-s,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],t.translateSelectedEditors,{args:[-o,0],checker:i}],[["ArrowRight","mac+ArrowRight"],t.translateSelectedEditors,{args:[s,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],t.translateSelectedEditors,{args:[o,0],checker:i}],[["ArrowUp","mac+ArrowUp"],t.translateSelectedEditors,{args:[0,-s],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],t.translateSelectedEditors,{args:[0,-o],checker:i}],[["ArrowDown","mac+ArrowDown"],t.translateSelectedEditors,{args:[0,s],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],t.translateSelectedEditors,{args:[0,o],checker:i}]]))}constructor(t,i,r,s,o,a,l,c,u,d,h){let f=this._signal=this.#e.signal;this.#V=t,this.#j=i,this.#r=r,this._eventBus=s,s._on("editingaction",this.onEditingAction.bind(this),{signal:f}),s._on("pagechanging",this.onPageChanging.bind(this),{signal:f}),s._on("scalechanging",this.onScaleChanging.bind(this),{signal:f}),s._on("rotationchanging",this.onRotationChanging.bind(this),{signal:f}),s._on("setpreference",this.onSetPreference.bind(this),{signal:f}),s._on("switchannotationeditorparams",p=>this.updateParams(p.type,p.value),{signal:f}),this.#ee(),this.#re(),this.#q(),this.#s=o.annotationStorage,this.#m=o.filterFactory,this.#P=a,this.#C=l||null,this.#f=c,this.#g=u,this.#v=d,this.#N=h||null,this.viewParameters={realScale:Gi.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1}destroy(){this.#k?.resolve(),this.#k=null,this.#e?.abort(),this.#e=null,this._signal=null;for(let t of this.#i.values())t.destroy();this.#i.clear(),this.#n.clear(),this.#p.clear(),this.#t=null,this.#b.clear(),this.#c.destroy(),this.#r?.destroy(),this.#E?.hide(),this.#E=null,this.#y&&(clearTimeout(this.#y),this.#y=null),this.#L&&(clearTimeout(this.#L),this.#L=null)}combinedSignal(t){return AbortSignal.any([this._signal,t.signal])}get mlManager(){return this.#N}get useNewAltTextFlow(){return this.#g}get useNewAltTextWhenAddingImage(){return this.#v}get hcmFilter(){return de(this,"hcmFilter",this.#P?this.#m.addHCMFilter(this.#P.foreground,this.#P.background):"none")}get direction(){return de(this,"direction",getComputedStyle(this.#V).direction)}get highlightColors(){return de(this,"highlightColors",this.#C?new Map(this.#C.split(",").map(t=>t.split("=").map(i=>i.trim()))):null)}get highlightColorNames(){return de(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,t=>t.reverse())):null)}setMainHighlightColorPicker(t){this.#R=t}editAltText(t,i=!1){this.#r?.editAltText(this,t,i)}switchToMode(t,i){this._eventBus.on("annotationeditormodechanged",i,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:t})}setPreference(t,i){this._eventBus.dispatch("setpreference",{source:this,name:t,value:i})}onSetPreference({name:t,value:i}){switch(t){case"enableNewAltTextWhenAddingImage":this.#v=i;break}}onPageChanging({pageNumber:t}){this.#a=t-1}focusMainContainer(){this.#V.focus()}findParent(t,i){for(let r of this.#i.values()){let{x:s,y:o,width:a,height:l}=r.div.getBoundingClientRect();if(t>=s&&t<=s+a&&i>=o&&i<=o+l)return r}return null}disableUserSelect(t=!1){this.#j.classList.toggle("noUserSelect",t)}addShouldRescale(t){this.#p.add(t)}removeShouldRescale(t){this.#p.delete(t)}onScaleChanging({scale:t}){this.commitOrRemove(),this.viewParameters.realScale=t*Gi.PDF_TO_CSS_UNITS;for(let i of this.#p)i.onScaleChanging()}onRotationChanging({pagesRotation:t}){this.commitOrRemove(),this.viewParameters.rotation=t}#z({anchorNode:t}){return t.nodeType===Node.TEXT_NODE?t.parentElement:t}#G(t){let{currentLayer:i}=this;if(i.hasTextLayer(t))return i;for(let r of this.#i.values())if(r.hasTextLayer(t))return r;return null}highlightSelection(t=""){let i=document.getSelection();if(!i||i.isCollapsed)return;let{anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a}=i,l=i.toString(),u=this.#z(i).closest(".textLayer"),d=this.getSelectionBoxes(u);if(!d)return;i.empty();let h=this.#G(u),f=this.#D===te.NONE,p=()=>{h?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:t,boxes:d,anchorNode:r,anchorOffset:s,focusNode:o,focusOffset:a,text:l}),f&&this.showAllEditors("highlight",!0,!0)};if(f){this.switchToMode(te.HIGHLIGHT,p);return}p()}#Q(){let t=document.getSelection();if(!t||t.isCollapsed)return;let r=this.#z(t).closest(".textLayer"),s=this.getSelectionBoxes(r);s&&(this.#E||=new rv(this),this.#E.show(r,s,this.direction==="ltr"))}addToAnnotationStorage(t){!t.isEmpty()&&this.#s&&!this.#s.has(t.id)&&this.#s.setValue(t.id,t)}#J(){let t=document.getSelection();if(!t||t.isCollapsed){this.#T&&(this.#E?.hide(),this.#T=null,this.#O({hasSelectedText:!1}));return}let{anchorNode:i}=t;if(i===this.#T)return;let s=this.#z(t).closest(".textLayer");if(!s){this.#T&&(this.#E?.hide(),this.#T=null,this.#O({hasSelectedText:!1}));return}if(this.#E?.hide(),this.#T=i,this.#O({hasSelectedText:!0}),!(this.#D!==te.HIGHLIGHT&&this.#D!==te.NONE)&&(this.#D===te.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#_=this.isShiftKeyDown,!this.isShiftKeyDown)){let o=this.#D===te.HIGHLIGHT?this.#G(s):null;o?.toggleDrawing();let a=new AbortController,l=this.combinedSignal(a),c=u=>{u.type==="pointerup"&&u.button!==0||(a.abort(),o?.toggleDrawing(!0),u.type==="pointerup"&&this.#W("main_toolbar"))};window.addEventListener("pointerup",c,{signal:l}),window.addEventListener("blur",c,{signal:l})}}#W(t=""){this.#D===te.HIGHLIGHT?this.highlightSelection(t):this.#f&&this.#Q()}#ee(){document.addEventListener("selectionchange",this.#J.bind(this),{signal:this._signal})}#te(){if(this.#w)return;this.#w=new AbortController;let t=this.combinedSignal(this.#w);window.addEventListener("focus",this.focus.bind(this),{signal:t}),window.addEventListener("blur",this.blur.bind(this),{signal:t})}#ne(){this.#w?.abort(),this.#w=null}blur(){if(this.isShiftKeyDown=!1,this.#_&&(this.#_=!1,this.#W("main_toolbar")),!this.hasSelection)return;let{activeElement:t}=document;for(let i of this.#b)if(i.div.contains(t)){this.#S=[i,t],i._focusEventsAllowed=!1;break}}focus(){if(!this.#S)return;let[t,i]=this.#S;this.#S=null,i.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this._signal}),i.focus()}#q(){if(this.#I)return;this.#I=new AbortController;let t=this.combinedSignal(this.#I);window.addEventListener("keydown",this.keydown.bind(this),{signal:t}),window.addEventListener("keyup",this.keyup.bind(this),{signal:t})}#ie(){this.#I?.abort(),this.#I=null}#Y(){if(this.#u)return;this.#u=new AbortController;let t=this.combinedSignal(this.#u);document.addEventListener("copy",this.copy.bind(this),{signal:t}),document.addEventListener("cut",this.cut.bind(this),{signal:t}),document.addEventListener("paste",this.paste.bind(this),{signal:t})}#X(){this.#u?.abort(),this.#u=null}#re(){let t=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:t}),document.addEventListener("drop",this.drop.bind(this),{signal:t})}addEditListeners(){this.#q(),this.#Y()}removeEditListeners(){this.#ie(),this.#X()}dragOver(t){for(let{type:i}of t.dataTransfer.items)for(let r of this.#h)if(r.isHandlingMimeForPasting(i)){t.dataTransfer.dropEffect="copy",t.preventDefault();return}}drop(t){for(let i of t.dataTransfer.items)for(let r of this.#h)if(r.isHandlingMimeForPasting(i.type)){r.paste(i,this.currentLayer),t.preventDefault();return}}copy(t){if(t.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;let i=[];for(let r of this.#b){let s=r.serialize(!0);s&&i.push(s)}i.length!==0&&t.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(t){this.copy(t),this.delete()}paste(t){return A(this,null,function*(){t.preventDefault();let{clipboardData:i}=t;for(let o of i.items)for(let a of this.#h)if(a.isHandlingMimeForPasting(o.type)){a.paste(o,this.currentLayer);return}let r=i.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(o){ie(`paste: "${o.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();let s=this.currentLayer;try{let o=[];for(let c of r){let u=yield s.deserialize(c);if(!u)return;o.push(u)}let a=()=>{for(let c of o)this.#K(c);this.#Z(o)},l=()=>{for(let c of o)c.remove()};this.addCommands({cmd:a,undo:l,mustExec:!0})}catch(o){ie(`paste: "${o.message}".`)}})}keydown(t){!this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!0),this.#D!==te.NONE&&!this.isEditorHandlingKeyboard&&n._keyboardManager.exec(this,t)}keyup(t){this.isShiftKeyDown&&t.key==="Shift"&&(this.isShiftKeyDown=!1,this.#_&&(this.#_=!1,this.#W("main_toolbar")))}onEditingAction({name:t}){switch(t){case"undo":case"redo":case"delete":case"selectAll":this[t]();break;case"highlightSelection":this.highlightSelection("context_menu");break}}#O(t){Object.entries(t).some(([r,s])=>this.#U[r]!==s)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#U,t)}),this.#D===te.HIGHLIGHT&&t.hasSelectedEditor===!1&&this.#H([[q.HIGHLIGHT_FREE,!0]]))}#H(t){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:t})}setEditingState(t){t?(this.#te(),this.#Y(),this.#O({isEditing:this.#D!==te.NONE,isEmpty:this.#$(),hasSomethingToUndo:this.#c.hasSomethingToUndo(),hasSomethingToRedo:this.#c.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ne(),this.#X(),this.#O({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(t){if(!this.#h){this.#h=t;for(let i of this.#h)this.#H(i.defaultPropertiesToUpdate)}}getId(){return this.#M.id}get currentLayer(){return this.#i.get(this.#a)}getLayer(t){return this.#i.get(t)}get currentPageIndex(){return this.#a}addLayer(t){this.#i.set(t.pageIndex,t),this.#x?t.enable():t.disable()}removeLayer(t){this.#i.delete(t.pageIndex)}updateMode(t,i=null,r=!1){return A(this,null,function*(){if(this.#D!==t&&!(this.#k&&(yield this.#k.promise,!this.#k))){if(this.#k=Promise.withResolvers(),this.#D=t,t===te.NONE){this.setEditingState(!1),this.#oe(),this.#k.resolve();return}this.setEditingState(!0),yield this.#se(),this.unselectAll();for(let s of this.#i.values())s.updateMode(t);if(!i){r&&this.addNewEditorFromKeyboard(),this.#k.resolve();return}for(let s of this.#n.values())s.annotationElementId===i?(this.setSelected(s),s.enterInEditMode()):s.unselect();this.#k.resolve()}})}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(t){t!==this.#D&&this._eventBus.dispatch("switchannotationeditormode",{source:this,mode:t})}updateParams(t,i){if(this.#h){switch(t){case q.CREATE:this.currentLayer.addNewEditor();return;case q.HIGHLIGHT_DEFAULT_COLOR:this.#R?.updateColor(i);break;case q.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#F||=new Map).set(t,i),this.showAllEditors("highlight",i);break}for(let r of this.#b)r.updateParams(t,i);for(let r of this.#h)r.updateDefaultParams(t,i)}}showAllEditors(t,i,r=!1){for(let o of this.#n.values())o.editorType===t&&o.show(i);(this.#F?.get(q.HIGHLIGHT_SHOW_ALL)??!0)!==i&&this.#H([[q.HIGHLIGHT_SHOW_ALL,i]])}enableWaiting(t=!1){if(this.#A!==t){this.#A=t;for(let i of this.#i.values())t?i.disableClick():i.enableClick(),i.div.classList.toggle("waiting",t)}}#se(){return A(this,null,function*(){if(!this.#x){this.#x=!0;let t=[];for(let i of this.#i.values())t.push(i.enable());yield Promise.all(t);for(let i of this.#n.values())i.enable()}})}#oe(){if(this.unselectAll(),this.#x){this.#x=!1;for(let t of this.#i.values())t.disable();for(let t of this.#n.values())t.disable()}}getEditors(t){let i=[];for(let r of this.#n.values())r.pageIndex===t&&i.push(r);return i}getEditor(t){return this.#n.get(t)}addEditor(t){this.#n.set(t.id,t)}removeEditor(t){t.div.contains(document.activeElement)&&(this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.focusMainContainer(),this.#y=null},0)),this.#n.delete(t.id),this.unselect(t),(!t.annotationElementId||!this.#d.has(t.annotationElementId))&&this.#s?.remove(t.id)}addDeletedAnnotationElement(t){this.#d.add(t.annotationElementId),this.addChangedExistingAnnotation(t),t.deleted=!0}isDeletedAnnotationElement(t){return this.#d.has(t)}removeDeletedAnnotationElement(t){this.#d.delete(t.annotationElementId),this.removeChangedExistingAnnotation(t),t.deleted=!1}#K(t){let i=this.#i.get(t.pageIndex);i?i.addOrRebuild(t):(this.addEditor(t),this.addToAnnotationStorage(t))}setActiveEditor(t){this.#t!==t&&(this.#t=t,t&&this.#H(t.propertiesToUpdate))}get#ae(){let t=null;for(t of this.#b);return t}updateUI(t){this.#ae===t&&this.#H(t.propertiesToUpdate)}toggleSelected(t){if(this.#b.has(t)){this.#b.delete(t),t.unselect(),this.#O({hasSelectedEditor:this.hasSelection});return}this.#b.add(t),t.select(),this.#H(t.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}setSelected(t){for(let i of this.#b)i!==t&&i.unselect();this.#b.clear(),this.#b.add(t),t.select(),this.#H(t.propertiesToUpdate),this.#O({hasSelectedEditor:!0})}isSelected(t){return this.#b.has(t)}get firstSelectedEditor(){return this.#b.values().next().value}unselect(t){t.unselect(),this.#b.delete(t),this.#O({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#b.size!==0}get isEnterHandled(){return this.#b.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#c.undo(),this.#O({hasSomethingToUndo:this.#c.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#$()})}redo(){this.#c.redo(),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:this.#c.hasSomethingToRedo(),isEmpty:this.#$()})}addCommands(t){this.#c.add(t),this.#O({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#$()})}#$(){if(this.#n.size===0)return!0;if(this.#n.size===1)for(let t of this.#n.values())return t.isEmpty();return!1}delete(){if(this.commitOrRemove(),!this.hasSelection)return;let t=[...this.#b],i=()=>{for(let s of t)s.remove()},r=()=>{for(let s of t)this.#K(s)};this.addCommands({cmd:i,undo:r,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#Z(t){for(let i of this.#b)i.unselect();this.#b.clear();for(let i of t)i.isEmpty()||(this.#b.add(i),i.select());this.#O({hasSelectedEditor:this.hasSelection})}selectAll(){for(let t of this.#b)t.commit();this.#Z(this.#n.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#D!==te.NONE))&&this.hasSelection){for(let t of this.#b)t.unselect();this.#b.clear(),this.#O({hasSelectedEditor:!1})}}translateSelectedEditors(t,i,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;this.#B[0]+=t,this.#B[1]+=i;let[s,o]=this.#B,a=[...this.#b],l=1e3;this.#L&&clearTimeout(this.#L),this.#L=setTimeout(()=>{this.#L=null,this.#B[0]=this.#B[1]=0,this.addCommands({cmd:()=>{for(let c of a)this.#n.has(c.id)&&c.translateInPage(s,o)},undo:()=>{for(let c of a)this.#n.has(c.id)&&c.translateInPage(-s,-o)},mustExec:!1})},l);for(let c of a)c.translateInPage(t,i)}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#o=new Map;for(let t of this.#b)this.#o.set(t,{savedX:t.x,savedY:t.y,savedPageIndex:t.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#o)return!1;this.disableUserSelect(!1);let t=this.#o;this.#o=null;let i=!1;for(let[{x:s,y:o,pageIndex:a},l]of t)l.newX=s,l.newY=o,l.newPageIndex=a,i||=s!==l.savedX||o!==l.savedY||a!==l.savedPageIndex;if(!i)return!1;let r=(s,o,a,l)=>{if(this.#n.has(s.id)){let c=this.#i.get(l);c?s._setParentAndPosition(c,o,a):(s.pageIndex=l,s.x=o,s.y=a)}};return this.addCommands({cmd:()=>{for(let[s,{newX:o,newY:a,newPageIndex:l}]of t)r(s,o,a,l)},undo:()=>{for(let[s,{savedX:o,savedY:a,savedPageIndex:l}]of t)r(s,o,a,l)},mustExec:!0}),!0}dragSelectedEditors(t,i){if(this.#o)for(let r of this.#o.keys())r.drag(t,i)}rebuild(t){if(t.parent===null){let i=this.getLayer(t.pageIndex);i?(i.changeParent(t),i.addOrRebuild(t)):(this.addEditor(t),this.addToAnnotationStorage(t),t.rebuild())}else t.parent.addOrRebuild(t)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#b.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(t){return this.#t===t}getActive(){return this.#t}getMode(){return this.#D}get imageManager(){return de(this,"imageManager",new ov)}getSelectionBoxes(t){if(!t)return null;let i=document.getSelection();for(let u=0,d=i.rangeCount;u({x:(d-s)/a,y:1-(u+h-r)/o,width:f/a,height:h/o});break;case"180":l=(u,d,h,f)=>({x:1-(u+h-r)/o,y:1-(d+f-s)/a,width:h/o,height:f/a});break;case"270":l=(u,d,h,f)=>({x:1-(d+f-s)/a,y:(u-r)/o,width:f/a,height:h/o});break;default:l=(u,d,h,f)=>({x:(u-r)/o,y:(d-s)/a,width:h/o,height:f/a});break}let c=[];for(let u=0,d=i.rangeCount;u{class n{#e=null;#t=!1;#n=null;#i=null;#r=null;#s=null;#l=!1;#c=null;#u=null;#a=null;#d=null;#o=!1;static#h=null;static _l10n=null;constructor(t){this.#u=t,this.#o=t._uiManager.useNewAltTextFlow,n.#h||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(t){n._l10n??=t}render(){return A(this,null,function*(){let t=this.#n=document.createElement("button");t.className="altText",t.tabIndex="0";let i=this.#i=document.createElement("span");t.append(i),this.#o?(t.classList.add("new"),t.setAttribute("data-l10n-id",n.#h.missing),i.setAttribute("data-l10n-id",n.#h["missing-label"])):(t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));let r=this.#u._uiManager._signal;t.addEventListener("contextmenu",hn,{signal:r}),t.addEventListener("pointerdown",o=>o.stopPropagation(),{signal:r});let s=o=>{o.preventDefault(),this.#u._uiManager.editAltText(this.#u),this.#o&&this.#u._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#p}})};return t.addEventListener("click",s,{capture:!0,signal:r}),t.addEventListener("keydown",o=>{o.target===t&&o.key==="Enter"&&(this.#l=!0,s(o))},{signal:r}),yield this.#f(),t})}get#p(){return this.#e&&"added"||this.#e===null&&this.guessedText&&"review"||"missing"}finish(){this.#n&&(this.#n.focus({focusVisible:this.#l}),this.#l=!1)}isEmpty(){return this.#o?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#o?this.#e!==null||!!this.#a:this.isEmpty()}get guessedText(){return this.#a}setGuessedText(t){return A(this,null,function*(){this.#e===null&&(this.#a=t,this.#d=yield n._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:t}),this.#f())})}toggleAltTextBadge(t=!1){if(!this.#o||this.#e){this.#c?.remove(),this.#c=null;return}if(!this.#c){let i=this.#c=document.createElement("div");i.className="noAltTextBadge",this.#u.div.append(i)}this.#c.classList.toggle("hidden",!t)}serialize(t){let i=this.#e;return!t&&this.#a===i&&(i=this.#d),{altText:i,decorative:this.#t,guessedText:this.#a,textWithDisclaimer:this.#d}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:t,decorative:i,guessedText:r,textWithDisclaimer:s,cancel:o=!1}){r&&(this.#a=r,this.#d=s),!(this.#e===t&&this.#t===i)&&(o||(this.#e=t,this.#t=i),this.#f())}toggle(t=!1){this.#n&&(!t&&this.#s&&(clearTimeout(this.#s),this.#s=null),this.#n.disabled=!t)}shown(){this.#u._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#p}})}destroy(){this.#n?.remove(),this.#n=null,this.#i=null,this.#r=null,this.#c?.remove(),this.#c=null}#f(){return A(this,null,function*(){let t=this.#n;if(!t)return;if(this.#o){if(t.classList.toggle("done",!!this.#e),t.setAttribute("data-l10n-id",n.#h[this.#p]),this.#i?.setAttribute("data-l10n-id",n.#h[`${this.#p}-label`]),!this.#e){this.#r?.remove();return}}else{if(!this.#e&&!this.#t){t.classList.remove("done"),this.#r?.remove();return}t.classList.add("done"),t.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let i=this.#r;if(!i){this.#r=i=document.createElement("span"),i.className="tooltip",i.setAttribute("role","tooltip"),i.id=`alt-text-tooltip-${this.#u.id}`;let s=100,o=this.#u._uiManager._signal;o.addEventListener("abort",()=>{clearTimeout(this.#s),this.#s=null},{once:!0}),t.addEventListener("mouseenter",()=>{this.#s=setTimeout(()=>{this.#s=null,this.#r.classList.add("show"),this.#u._reportTelemetry({action:"alt_text_tooltip"})},s)},{signal:o}),t.addEventListener("mouseleave",()=>{this.#s&&(clearTimeout(this.#s),this.#s=null),this.#r?.classList.remove("show")},{signal:o})}this.#t?i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(i.removeAttribute("data-l10n-id"),i.textContent=this.#e),i.parentNode||t.append(i),this.#u.getImageForAltText()?.setAttribute("aria-describedby",i.id)})}}return n})(),_e=class n{#e=null;#t=null;#n=null;#i=!1;#r=!1;#s=null;#l=null;#c=null;#u="";#a=!1;#d=null;#o=!1;#h=!1;#p=!1;#f=null;#g=0;#v=0;#m=null;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#y=!1;#w=n._zIndex++;static _borderLineWidth=-1;static _colorManager=new lv;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let e=n.prototype._resizeWithKeyboard,t=Za.TRANSLATE_SMALL,i=Za.TRANSLATE_BIG;return de(this,"_resizerKeyboardManager",new Fr([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-t,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-i,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[t,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[i,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-t]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-i]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,t]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,i]}],[["Escape","mac+Escape"],n.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null;let{rotation:t,rawDims:{pageWidth:i,pageHeight:r,pageX:s,pageY:o}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[i,r],this.pageTranslation=[s,o];let[a,l]=this.parentDimensions;this.x=e.x/a,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}static get _defaultLineColor(){return de(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){let t=new cv({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(e,t){if(n._l10n??=e,n._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),n._borderLineWidth!==-1)return;let i=getComputedStyle(document.documentElement);n._borderLineWidth=parseFloat(i.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){Pe("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#y}set _isDraggable(e){this.#y=e,this.div?.classList.toggle("draggable",e)}get isEnterHandled(){return!0}center(){let[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#w}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):this.#F(),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#a?this.#a=!1:this.parent.setSelected(this))}focusout(e){!this._focusEventsAllowed||!this.isAttachedToDOM||e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,i,r){let[s,o]=this.parentDimensions;[i,r]=this.screenToPageTranslation(i,r),this.x=(e+i)/s,this.y=(t+r)/o,this.fixAndSetPosition()}#C([e,t],i,r){[i,r]=this.screenToPageTranslation(i,r),this.x+=i/e,this.y+=r/t,this.fixAndSetPosition()}translate(e,t){this.#C(this.parentDimensions,e,t)}translateInPage(e,t){this.#d||=[this.x,this.y],this.#C(this.pageDimensions,e,t),this.div.scrollIntoView({block:"nearest"})}drag(e,t){this.#d||=[this.x,this.y];let[i,r]=this.parentDimensions;if(this.x+=e/i,this.y+=t/r,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:c,y:u}=this.div.getBoundingClientRect();this.parent.findNewParent(this,c,u)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:o}=this,[a,l]=this.getBaseTranslation();s+=a,o+=l,this.div.style.left=`${(100*s).toFixed(2)}%`,this.div.style.top=`${(100*o).toFixed(2)}%`,this.div.scrollIntoView({block:"nearest"})}get _hasBeenMoved(){return!!this.#d&&(this.#d[0]!==this.x||this.#d[1]!==this.y)}getBaseTranslation(){let[e,t]=this.parentDimensions,{_borderLineWidth:i}=n,r=i/e,s=i/t;switch(this.rotation){case 90:return[-r,s];case 180:return[r,s];case 270:return[r,-s];default:return[-r,-s]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){let[t,i]=this.pageDimensions,{x:r,y:s,width:o,height:a}=this;if(o*=t,a*=i,r*=t,s*=i,this._mustFixPosition)switch(e){case 0:r=Math.max(0,Math.min(t-o,r)),s=Math.max(0,Math.min(i-a,s));break;case 90:r=Math.max(0,Math.min(t-a,r)),s=Math.min(i,Math.max(o,s));break;case 180:r=Math.min(t,Math.max(o,r)),s=Math.min(i,Math.max(a,s));break;case 270:r=Math.min(t,Math.max(a,r)),s=Math.max(0,Math.min(i-o,s));break}this.x=r/=t,this.y=s/=i;let[l,c]=this.getBaseTranslation();r+=l,s+=c;let{style:u}=this.div;u.left=`${(100*r).toFixed(2)}%`,u.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#_(e,t,i){switch(i){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(e,t){return n.#_(e,t,this.parentRotation)}pageTranslationToScreen(e,t){return n.#_(e,t,360-this.parentRotation)}#E(e){switch(e){case 90:{let[t,i]=this.pageDimensions;return[0,-t/i,i/t,0]}case 180:return[-1,0,0,-1];case 270:{let[t,i]=this.pageDimensions;return[0,t/i,-i/t,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:e,pageDimensions:[t,i]}=this;return[t*e,i*e]}setDims(e,t){let[i,r]=this.parentDimensions;this.div.style.width=`${(100*e/i).toFixed(2)}%`,this.#r||(this.div.style.height=`${(100*t/r).toFixed(2)}%`)}fixDims(){let{style:e}=this.div,{height:t,width:i}=e,r=i.endsWith("%"),s=!this.#r&&t.endsWith("%");if(r&&s)return;let[o,a]=this.parentDimensions;r||(e.width=`${(100*parseFloat(i)/o).toFixed(2)}%`),!this.#r&&!s&&(e.height=`${(100*parseFloat(t)/a).toFixed(2)}%`)}getInitialTranslation(){return[0,0]}#M(){if(this.#s)return;this.#s=document.createElement("div"),this.#s.classList.add("resizers");let e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],t=this._uiManager._signal;for(let i of e){let r=document.createElement("div");this.#s.append(r),r.classList.add("resizer",i),r.setAttribute("data-resizer-name",i),r.addEventListener("pointerdown",this.#x.bind(this,i),{signal:t}),r.addEventListener("contextmenu",hn,{signal:t}),r.tabIndex=-1}this.div.prepend(this.#s)}#x(e,t){t.preventDefault();let{isMac:i}=pt.platform;if(t.button!==0||t.ctrlKey&&i)return;this.#n?.toggle(!1);let r=this._isDraggable;this._isDraggable=!1;let s=new AbortController,o=this._uiManager.combinedSignal(s);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#I.bind(this,e),{passive:!0,capture:!0,signal:o}),window.addEventListener("contextmenu",hn,{signal:o});let a=this.x,l=this.y,c=this.width,u=this.height,d=this.parent.div.style.cursor,h=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;let f=()=>{s.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=r,this.parent.div.style.cursor=d,this.div.style.cursor=h,this.#A(a,l,c,u)};window.addEventListener("pointerup",f,{signal:o}),window.addEventListener("blur",f,{signal:o})}#A(e,t,i,r){let s=this.x,o=this.y,a=this.width,l=this.height;s===e&&o===t&&a===i&&l===r||this.addCommands({cmd:()=>{this.width=a,this.height=l,this.x=s,this.y=o;let[c,u]=this.parentDimensions;this.setDims(c*a,u*l),this.fixAndSetPosition()},undo:()=>{this.width=i,this.height=r,this.x=e,this.y=t;let[c,u]=this.parentDimensions;this.setDims(c*i,u*r),this.fixAndSetPosition()},mustExec:!0})}#I(e,t){let[i,r]=this.parentDimensions,s=this.x,o=this.y,a=this.width,l=this.height,c=n.MIN_SIZE/i,u=n.MIN_SIZE/r,d=H=>Math.round(H*1e4)/1e4,h=this.#E(this.rotation),f=(H,ne)=>[h[0]*H+h[2]*ne,h[1]*H+h[3]*ne],p=this.#E(360-this.rotation),g=(H,ne)=>[p[0]*H+p[2]*ne,p[1]*H+p[3]*ne],v,m,y=!1,b=!1;switch(e){case"topLeft":y=!0,v=(H,ne)=>[0,0],m=(H,ne)=>[H,ne];break;case"topMiddle":v=(H,ne)=>[H/2,0],m=(H,ne)=>[H/2,ne];break;case"topRight":y=!0,v=(H,ne)=>[H,0],m=(H,ne)=>[0,ne];break;case"middleRight":b=!0,v=(H,ne)=>[H,ne/2],m=(H,ne)=>[0,ne/2];break;case"bottomRight":y=!0,v=(H,ne)=>[H,ne],m=(H,ne)=>[0,0];break;case"bottomMiddle":v=(H,ne)=>[H/2,ne],m=(H,ne)=>[H/2,0];break;case"bottomLeft":y=!0,v=(H,ne)=>[0,ne],m=(H,ne)=>[H,0];break;case"middleLeft":b=!0,v=(H,ne)=>[0,ne/2],m=(H,ne)=>[H,ne/2];break}let w=v(a,l),E=m(a,l),S=f(...E),I=d(s+S[0]),M=d(o+S[1]),_=1,C=1,[R,ge]=this.screenToPageTranslation(t.movementX,t.movementY);if([R,ge]=g(R/i,ge/r),y){let H=Math.hypot(a,l);_=C=Math.max(Math.min(Math.hypot(E[0]-w[0]-R,E[1]-w[1]-ge)/H,1/a,1/l),c/a,u/l)}else b?_=Math.max(c,Math.min(1,Math.abs(E[0]-w[0]-R)))/a:C=Math.max(u,Math.min(1,Math.abs(E[1]-w[1]-ge)))/l;let he=d(a*_),le=d(l*C);S=f(...m(he,le));let Ee=I-S[0],Ve=M-S[1];this.width=he,this.height=le,this.x=Ee,this.y=Ve,this.setDims(i*he,r*le),this.fixAndSetPosition()}altTextFinish(){this.#n?.finish()}addEditToolbar(){return A(this,null,function*(){return this._editToolbar||this.#h?this._editToolbar:(this._editToolbar=new iv(this),this.div.append(this._editToolbar.render()),this.#n&&(yield this._editToolbar.addAltText(this.#n)),this._editToolbar)})}removeEditToolbar(){this._editToolbar&&(this._editToolbar.remove(),this._editToolbar=null,this.#n?.destroy())}addContainer(e){let t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}addAltTextButton(){return A(this,null,function*(){this.#n||(pD.initialize(n._l10n),this.#n=new pD(this),this.#e&&(this.#n.data=this.#e,this.#e=null),yield this.addEditToolbar())})}get altTextData(){return this.#n?.data}set altTextData(e){this.#n&&(this.#n.data=e)}get guessedAltText(){return this.#n?.guessedText}setGuessedAltText(e){return A(this,null,function*(){yield this.#n?.setGuessedText(e)})}serializeAltText(e){return this.#n?.serialize(e)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}render(){this.div=document.createElement("div"),this.div.setAttribute("data-editor-rotation",(360-this.rotation)%360),this.div.className=this.name,this.div.setAttribute("id",this.id),this.div.tabIndex=this.#i?-1:0,this._isVisible||this.div.classList.add("hidden"),this.setInForeground(),this.#N();let[e,t]=this.parentDimensions;this.parentRotation%180!==0&&(this.div.style.maxWidth=`${(100*t/e).toFixed(2)}%`,this.div.style.maxHeight=`${(100*e/t).toFixed(2)}%`);let[i,r]=this.getInitialTranslation();return this.translate(i,r),Ld(this,this.div,["pointerdown"]),this.div}pointerdown(e){let{isMac:t}=pt.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(this.#a=!0,this._isDraggable){this.#R(e);return}this.#S(e)}get isSelected(){return this._uiManager.isSelected(this)}#S(e){let{isMac:t}=pt.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#R(e){let{isSelected:t}=this;this._uiManager.setUpDragSession();let i=new AbortController,r=this._uiManager.combinedSignal(i);if(t){this.div.classList.add("moving"),this.#g=e.clientX,this.#v=e.clientY;let o=a=>{let{clientX:l,clientY:c}=a,[u,d]=this.screenToPageTranslation(l-this.#g,c-this.#v);this.#g=l,this.#v=c,this._uiManager.dragSelectedEditors(u,d)};window.addEventListener("pointermove",o,{passive:!0,capture:!0,signal:r})}let s=()=>{i.abort(),t&&this.div.classList.remove("moving"),this.#a=!1,this._uiManager.endDragSession()||this.#S(e)};window.addEventListener("pointerup",s,{signal:r}),window.addEventListener("blur",s,{signal:r})}moveInDOM(){this.#f&&clearTimeout(this.#f),this.#f=setTimeout(()=>{this.#f=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,i){e.changeParent(this),this.x=t,this.y=i,this.fixAndSetPosition()}getRect(e,t,i=this.rotation){let r=this.parentScale,[s,o]=this.pageDimensions,[a,l]=this.pageTranslation,c=e/r,u=t/r,d=this.x*s,h=this.y*o,f=this.width*s,p=this.height*o;switch(i){case 0:return[d+c+a,o-h-u-p+l,d+c+f+a,o-h-u+l];case 90:return[d+u+a,o-h+c+l,d+u+p+a,o-h+c+f+l];case 180:return[d-c-f+a,o-h+u+l,d-c+a,o-h+u+p+l];case 270:return[d-u-p+a,o-h-c-f+l,d-u+a,o-h-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,t){let[i,r,s,o]=e,a=s-i,l=o-r;switch(this.rotation){case 0:return[i,t-o,a,l];case 90:return[i,t-r,l,a];case 180:return[s,t-r,a,l];case 270:return[s,t-o,l,a];default:throw new Error("Invalid rotation")}}onceAdded(){}isEmpty(){return!1}enableEditMode(){this.#h=!0}disableEditMode(){this.#h=!1}isInEditMode(){return this.#h}shouldGetKeyboardEvents(){return this.#p}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}#N(){if(this.#c||!this.div)return;this.#c=new AbortController;let e=this._uiManager.combinedSignal(this.#c);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})}rebuild(){this.#N()}rotate(e){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,t=null){Pe("An editor must be serializable")}static deserialize(e,t,i){return A(this,null,function*(){let r=new this.prototype.constructor({parent:t,id:t.getNextId(),uiManager:i});r.rotation=e.rotation,r.#e=e.accessibilityData;let[s,o]=r.pageDimensions,[a,l,c,u]=r.getRectInCurrentCoords(e.rect,o);return r.x=a/s,r.y=l/o,r.width=c/s,r.height=u/o,r})}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#c?.abort(),this.#c=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.#f&&(clearTimeout(this.#f),this.#f=null),this.#F(),this.removeEditToolbar(),this.#m){for(let e of this.#m.values())clearTimeout(e);this.#m=null}this.parent=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#M(),this.#s.classList.remove("hidden"),Ld(this,this.div,["keydown"]))}get toolbarPosition(){return null}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),this.#l={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let t=this.#s.children;if(!this.#t){this.#t=Array.from(t);let o=this.#D.bind(this),a=this.#b.bind(this),l=this._uiManager._signal;for(let c of this.#t){let u=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",o,{signal:l}),c.addEventListener("blur",a,{signal:l}),c.addEventListener("focus",this.#T.bind(this,u),{signal:l}),c.setAttribute("data-l10n-id",n._l10nResizer[u])}}let i=this.#t[0],r=0;for(let o of t){if(o===i)break;r++}let s=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(s!==r){if(sr)for(let a=0;a{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)}unselect(){this.#s?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0)}updateParams(e,t){}disableEditing(){}enableEditing(){}enterInEditMode(){}getImageForAltText(){return null}get contentDiv(){return this.div}get isEditing(){return this.#o}set isEditing(e){this.#o=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}setAspectRatio(e,t){this.#r=!0;let i=e/t,{style:r}=this.div;r.aspectRatio=i,r.height="auto"}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,t=!1){if(t){this.#m||=new Map;let{action:i}=e,r=this.#m.get(i);r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(e),this.#m.delete(i),this.#m.size===0&&(this.#m=null)},n._telemetryTimeout),this.#m.set(i,r);return}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#i=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#i=!0}renderAnnotationElement(e){let t=e.container.querySelector(".annotationContent");if(!t)t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),e.container.prepend(t);else if(t.nodeName==="CANVAS"){let i=t;t=document.createElement("div"),t.classList.add("annotationContent",this.editorType),i.before(t)}return t}resetAnnotationElement(e){let{firstChild:t}=e.container;t?.nodeName==="DIV"&&t.classList.contains("annotationContent")&&t.remove()}},cv=class extends _e{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},gD=3285377520,dn=4294901760,Un=65535,Fd=class{constructor(e){this.h1=e?e&4294967295:gD,this.h2=e?e&4294967295:gD}update(e){let t,i;if(typeof e=="string"){t=new Uint8Array(e.length*2),i=0;for(let g=0,v=e.length;g>>8,t[i++]=m&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),i=t.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");let r=i>>2,s=i-r*4,o=new Uint32Array(t.buffer,0,r),a=0,l=0,c=this.h1,u=this.h2,d=3432918353,h=461845907,f=d&Un,p=h&Un;for(let g=0;g>>17,a=a*h&dn|a*p&Un,c^=a,c=c<<13|c>>>19,c=c*5+3864292196):(l=o[g],l=l*d&dn|l*f&Un,l=l<<15|l>>>17,l=l*h&dn|l*p&Un,u^=l,u=u<<13|u>>>19,u=u*5+3864292196);switch(a=0,s){case 3:a^=t[r*4+2]<<16;case 2:a^=t[r*4+1]<<8;case 1:a^=t[r*4],a=a*d&dn|a*f&Un,a=a<<15|a>>>17,a=a*h&dn|a*p&Un,r&1?c^=a:u^=a}this.h1=c,this.h2=u}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&dn|e*36045&Un,t=t*4283543511&dn|((t<<16|e>>>16)*2950163797&dn)>>>16,e^=t>>>1,e=e*444984403&dn|e*60499&Un,t=t*3301882366&dn|((t<<16|e>>>16)*3120437893&dn)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,"0")+(t>>>0).toString(16).padStart(8,"0")}},uv=Object.freeze({map:null,hash:"",transfer:void 0}),Qa=class{#e=!1;#t=null;#n=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,t){let i=this.#n.get(e);return i===void 0?t:Object.assign(t,i)}getRawValue(e){return this.#n.get(e)}remove(e){if(this.#n.delete(e),this.#n.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function"){for(let t of this.#n.values())if(t instanceof _e)return;this.onAnnotationEditor(null)}}setValue(e,t){let i=this.#n.get(e),r=!1;if(i!==void 0)for(let[s,o]of Object.entries(t))i[s]!==o&&(r=!0,i[s]=o);else r=!0,this.#n.set(e,t);r&&this.#i(),t instanceof _e&&typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(t.constructor._type)}has(e){return this.#n.has(e)}getAll(){return this.#n.size>0?by(this.#n):null}setAll(e){for(let[t,i]of Object.entries(e))this.setValue(t,i)}get size(){return this.#n.size}#i(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new Vd(this)}get serializable(){if(this.#n.size===0)return uv;let e=new Map,t=new Fd,i=[],r=Object.create(null),s=!1;for(let[o,a]of this.#n){let l=a instanceof _e?a.serialize(!1,r):a;l&&(e.set(o,l),t.update(`${o}:${JSON.stringify(l)}`),s||=!!l.bitmap)}if(s)for(let o of e.values())o.bitmap&&i.push(o.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:i}:uv}get editorStats(){let e=null,t=new Map;for(let i of this.#n.values()){if(!(i instanceof _e))continue;let r=i.telemetryFinalData;if(!r)continue;let{type:s}=r;t.has(s)||t.set(s,Object.getPrototypeOf(i).constructor),e||=Object.create(null);let o=e[s]||=new Map;for(let[a,l]of Object.entries(r)){if(a==="type")continue;let c=o.get(a);c||(c=new Map,o.set(a,c));let u=c.get(l)??0;c.set(l,u+1)}}for(let[i,r]of t)e[i]=r.computeTelemetryFinalData(e[i]);return e}resetModifiedIds(){this.#t=null}get modifiedIds(){if(this.#t)return this.#t;let e=[];for(let t of this.#n.values())!(t instanceof _e)||!t.annotationElementId||!t.serialize()||e.push(t.annotationElementId);return this.#t={ids:new Set(e),hash:e.join(",")}}},Vd=class extends Qa{#e;constructor(e){super();let{map:t,hash:i,transfer:r}=e.serializable,s=structuredClone(t,r?{transfer:r}:null);this.#e={map:s,hash:i,transfer:r}}get print(){Pe("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}get modifiedIds(){return de(this,"modifiedIds",{ids:new Set,hash:""})}},dv=class{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));let t=this.styleElement.sheet;t.insertRule(e,t.cssRules.length)}clear(){for(let e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}loadSystemFont(i){return A(this,arguments,function*({systemFontInfo:e,_inspectFont:t}){if(!(!e||this.#e.has(e.loadedName))){if(it(!this.disableFontFace,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:r,src:s,style:o}=e,a=new FontFace(r,s,o);this.addNativeFontFace(a);try{yield a.load(),this.#e.add(r),t?.(e)}catch{ie(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}Pe("Not implemented: loadSystemFont without the Font Loading API.")}})}bind(e){return A(this,null,function*(){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){yield this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){let i=e.createNativeFontFace();if(i){this.addNativeFontFace(i);try{yield i.loaded}catch(r){throw ie(`Failed to load font '${i.family}': '${r}'.`),e.disableFontFace=!0,r}}return}let t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;yield new Promise(i=>{let r=this._queueLoadingCallback(i);this._prepareFontLoadEvent(e,r)})}})}get isFontLoadingAPISupported(){let e=!!this._document?.fonts;return de(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){let e=!1;return(Et||typeof navigator<"u"&&typeof navigator?.userAgent=="string"&&/Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent))&&(e=!0),de(this,"isSyncFontLoadingSupported",e)}_queueLoadingCallback(e){function t(){for(it(!r.done,"completeRequest() cannot be called twice."),r.done=!0;i.length>0&&i[0].done;){let s=i.shift();setTimeout(s.callback,0)}}let{loadingRequests:i}=this,r={done:!1,complete:t,callback:e};return i.push(r),r}get _loadTestFont(){let e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return de(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,t){function i(w,E){return w.charCodeAt(E)<<24|w.charCodeAt(E+1)<<16|w.charCodeAt(E+2)<<8|w.charCodeAt(E+3)&255}function r(w,E,S,I){let M=w.substring(0,E),_=w.substring(E+S);return M+I+_}let s,o,a=this._document.createElement("canvas");a.width=1,a.height=1;let l=a.getContext("2d"),c=0;function u(w,E){if(++c>30){ie("Load test font never loaded."),E();return}if(l.font="30px "+w,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){E();return}setTimeout(u.bind(null,w,E))}let d=`lt${Date.now()}${this.loadTestFontId++}`,h=this._loadTestFont;h=r(h,976,d.length,d);let p=16,g=1482184792,v=i(h,p);for(s=0,o=d.length-3;s{b.remove(),t.complete()})}},hv=class{constructor(e,{disableFontFace:t=!1,inspectFont:i=null}){this.compiledGlyphs=Object.create(null);for(let r in e)this[r]=e[r];this.disableFontFace=t===!0,this._inspectFont=i}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{let t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,t)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let e=`url(data:${this.mimetype};base64,${PL(this.data)});`,t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let i=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(i+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${i}src:${e}}`}return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let i;try{i=e.get(this.loadedName+"_path_"+t)}catch(s){ie(`getPathGenerator - ignoring character: "${s}".`)}if(!Array.isArray(i)||i.length===0)return this.compiledGlyphs[t]=function(s,o){};let r=[];for(let s=0,o=i.length;sf.bezierCurveTo(a,l,c,u,d,h)),s+=6}break;case mi.MOVE_TO:{let[a,l]=i.slice(s,s+2);r.push(c=>c.moveTo(a,l)),s+=2}break;case mi.LINE_TO:{let[a,l]=i.slice(s,s+2);r.push(c=>c.lineTo(a,l)),s+=2}break;case mi.QUADRATIC_CURVE_TO:{let[a,l,c,u]=i.slice(s,s+4);r.push(d=>d.quadraticCurveTo(a,l,c,u)),s+=4}break;case mi.RESTORE:r.push(a=>a.restore());break;case mi.SAVE:r.push(a=>a.save());break;case mi.SCALE:it(r.length===2,"Scale command is only valid at the third position.");break;case mi.TRANSFORM:{let[a,l,c,u,d,h]=i.slice(s,s+6);r.push(f=>f.transform(a,l,c,u,d,h)),s+=6}break;case mi.TRANSLATE:{let[a,l]=i.slice(s,s+2);r.push(c=>c.translate(a,l)),s+=2}break}return this.compiledGlyphs[t]=function(o,a){r[0](o),r[1](o),o.scale(a,-a);for(let l=2,c=r.length;l({cMapData:r,isCompressed:this.isCompressed})).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)})})}_fetch(e){return A(this,null,function*(){Pe("Abstract method `_fetch` called.")})}},Ud=class extends Bd{_fetch(e){return A(this,null,function*(){let t=yield gh(e,this.isCompressed?"arraybuffer":"text");return t instanceof ArrayBuffer?new Uint8Array(t):ph(t)})}},Hd=class{addFilter(e){return"none"}addHCMFilter(e,t){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,t,i,r,s){return"none"}destroy(e=!1){}},pv=class extends Hd{#e;#t;#n;#i;#r;#s;#l=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#i=e,this.#r=t}get#c(){return this.#t||=new Map}get#u(){return this.#s||=new Map}get#a(){if(!this.#n){let e=this.#r.createElement("div"),{style:t}=e;t.visibility="hidden",t.contain="strict",t.width=t.height=0,t.position="absolute",t.top=t.left=0,t.zIndex=-1;let i=this.#r.createElementNS(yi,"svg");i.setAttribute("width",0),i.setAttribute("height",0),this.#n=this.#r.createElementNS(yi,"defs"),e.append(i),i.append(this.#n),this.#r.body.append(e)}return this.#n}#d(e){if(e.length===1){let l=e[0],c=new Array(256);for(let d=0;d<256;d++)c[d]=l[d]/255;let u=c.join(",");return[u,u,u]}let[t,i,r]=e,s=new Array(256),o=new Array(256),a=new Array(256);for(let l=0;l<256;l++)s[l]=t[l]/255,o[l]=i[l]/255,a[l]=r[l]/255;return[s.join(","),o.join(","),a.join(",")]}#o(e){if(this.#e===void 0){this.#e="";let t=this.#r.URL;t!==this.#r.baseURI&&(mh(t)?ie('#createUrl: ignore "data:"-URL for performance reasons.'):this.#e=t.split("#",1)[0])}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return"none";let t=this.#c.get(e);if(t)return t;let[i,r,s]=this.#d(e),o=e.length===1?i:`${i}${r}${s}`;if(t=this.#c.get(o),t)return this.#c.set(e,t),t;let a=`g_${this.#i}_transfer_map_${this.#l++}`,l=this.#o(a);this.#c.set(e,l),this.#c.set(o,l);let c=this.#f(a);return this.#v(i,r,s,c),l}addHCMFilter(e,t){let i=`${e}-${t}`,r="base",s=this.#u.get(r);if(s?.key===i||(s?(s.filter?.remove(),s.key=i,s.url="none",s.filter=null):(s={key:i,url:"none",filter:null},this.#u.set(r,s)),!e||!t))return s.url;let o=this.#y(e);e=B.makeHexColor(...o);let a=this.#y(t);if(t=B.makeHexColor(...a),this.#a.style.color="",e==="#000000"&&t==="#ffffff"||e===t)return s.url;let l=new Array(256);for(let f=0;f<=255;f++){let p=f/255;l[f]=p<=.03928?p/12.92:((p+.055)/1.055)**2.4}let c=l.join(","),u=`g_${this.#i}_hcm_filter`,d=s.filter=this.#f(u);this.#v(c,c,c,d),this.#p(d);let h=(f,p)=>{let g=o[f]/255,v=a[f]/255,m=new Array(p+1);for(let y=0;y<=p;y++)m[y]=g+y/p*(v-g);return m.join(",")};return this.#v(h(0,5),h(1,5),h(2,5),d),s.url=this.#o(u),s.url}addAlphaFilter(e){let t=this.#c.get(e);if(t)return t;let[i]=this.#d([e]),r=`alpha_${i}`;if(t=this.#c.get(r),t)return this.#c.set(e,t),t;let s=`g_${this.#i}_alpha_map_${this.#l++}`,o=this.#o(s);this.#c.set(e,o),this.#c.set(r,o);let a=this.#f(s);return this.#m(i,a),o}addLuminosityFilter(e){let t=this.#c.get(e||"luminosity");if(t)return t;let i,r;if(e?([i]=this.#d([e]),r=`luminosity_${i}`):r="luminosity",t=this.#c.get(r),t)return this.#c.set(e,t),t;let s=`g_${this.#i}_luminosity_map_${this.#l++}`,o=this.#o(s);this.#c.set(e,o),this.#c.set(r,o);let a=this.#f(s);return this.#h(a),e&&this.#m(i,a),o}addHighlightHCMFilter(e,t,i,r,s){let o=`${t}-${i}-${r}-${s}`,a=this.#u.get(e);if(a?.key===o||(a?(a.filter?.remove(),a.key=o,a.url="none",a.filter=null):(a={key:o,url:"none",filter:null},this.#u.set(e,a)),!t||!i))return a.url;let[l,c]=[t,i].map(this.#y.bind(this)),u=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),d=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[h,f]=[r,s].map(this.#y.bind(this));d{let w=new Array(256),E=(d-u)/b,S=m/255,I=(y-m)/(255*b),M=0;for(let _=0;_<=b;_++){let C=Math.round(u+_*E),R=S+_*I;for(let ge=M;ge<=C;ge++)w[ge]=R;M=C+1}for(let _=M;_<256;_++)w[_]=w[M-1];return w.join(",")},g=`g_${this.#i}_hcm_${e}_filter`,v=a.filter=this.#f(g);return this.#p(v),this.#v(p(h[0],f[0],5),p(h[1],f[1],5),p(h[2],f[2],5),v),a.url=this.#o(g),a.url}destroy(e=!1){e&&this.#u.size!==0||(this.#n&&(this.#n.parentNode.parentNode.remove(),this.#n=null),this.#t&&(this.#t.clear(),this.#t=null),this.#l=0)}#h(e){let t=this.#r.createElementNS(yi,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),e.append(t)}#p(e){let t=this.#r.createElementNS(yi,"feColorMatrix");t.setAttribute("type","matrix"),t.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(t)}#f(e){let t=this.#r.createElementNS(yi,"filter");return t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("id",e),this.#a.append(t),t}#g(e,t,i){let r=this.#r.createElementNS(yi,t);r.setAttribute("type","discrete"),r.setAttribute("tableValues",i),e.append(r)}#v(e,t,i,r){let s=this.#r.createElementNS(yi,"feComponentTransfer");r.append(s),this.#g(s,"feFuncR",e),this.#g(s,"feFuncG",t),this.#g(s,"feFuncB",i)}#m(e,t){let i=this.#r.createElementNS(yi,"feComponentTransfer");t.append(i),this.#g(i,"feFuncA",e)}#y(e){return this.#a.style.color=e,Ey(getComputedStyle(this.#a).getPropertyValue("color"))}},$d=class{constructor({baseUrl:e=null}){this.baseUrl=e}fetch(t){return A(this,arguments,function*({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");let i=`${this.baseUrl}${e}`;return this._fetch(i).catch(r=>{throw new Error(`Unable to load font data at: ${i}`)})})}_fetch(e){return A(this,null,function*(){Pe("Abstract method `_fetch` called.")})}},zd=class extends $d{_fetch(e){return A(this,null,function*(){let t=yield gh(e,"arraybuffer");return new Uint8Array(t)})}};Et&&(Rd=Promise.withResolvers(),Pd=null,A(void 0,null,function*(){let e=yield import("./chunk-L2HEV66R.js"),t=yield import("./chunk-BMBYILCS.js"),i=yield import("./chunk-ALIQTIYY.js"),r=yield import("./chunk-NYZOWURK.js"),s,o;return new Map(Object.entries({fs:e,http:t,https:i,url:r,canvas:s,path2d:o}))}).then(e=>{Pd=e,Rd.resolve()},e=>{ie(`loadPackages: ${e}`),Pd=new Map,Rd.resolve()}));var Rd,Pd,Hn=class{static get promise(){return Rd.promise}static get(e){return Pd?.get(e)}};function TD(n){return A(this,null,function*(){let t=yield Hn.get("fs").promises.readFile(n);return new Uint8Array(t)})}var gv=class extends Hd{},mv=class extends jd{_createCanvas(e,t){return Hn.get("canvas").createCanvas(e,t)}},vv=class extends Bd{_fetch(e){return A(this,null,function*(){return TD(e)})}},yv=class extends $d{_fetch(e){return A(this,null,function*(){return TD(e)})}},It={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function bv(n,e){if(!e)return;let t=e[2]-e[0],i=e[3]-e[1],r=new Path2D;r.rect(e[0],e[1],t,i),n.clip(r)}var Ja=class{getPattern(){Pe("Abstract method `getPattern` called.")}},wv=class extends Ja{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let t;this._type==="axial"?t=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(t=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(let i of this._colorStops)t.addColorStop(i[0],i[1]);return t}getPattern(e,t,i,r){let s;if(r===It.STROKE||r===It.FILL){let o=t.current.getClippedPathBoundingBox(r,Le(e))||[0,0,0,0],a=Math.ceil(o[2]-o[0])||1,l=Math.ceil(o[3]-o[1])||1,c=t.cachedCanvases.getCanvas("pattern",a,l),u=c.context;u.clearRect(0,0,u.canvas.width,u.canvas.height),u.beginPath(),u.rect(0,0,u.canvas.width,u.canvas.height),u.translate(-o[0],-o[1]),i=B.transform(i,[1,0,0,1,o[0],o[1]]),u.transform(...t.baseTransform),this.matrix&&u.transform(...this.matrix),bv(u,this._bbox),u.fillStyle=this._createGradient(u),u.fill(),s=e.createPattern(c.canvas,"no-repeat");let d=new DOMMatrix(i);s.setTransform(d)}else bv(e,this._bbox),s=this._createGradient(e);return s}};function Qm(n,e,t,i,r,s,o,a){let l=e.coords,c=e.colors,u=n.data,d=n.width*4,h;l[t+1]>l[i+1]&&(h=t,t=i,i=h,h=s,s=o,o=h),l[i+1]>l[r+1]&&(h=i,i=r,r=h,h=o,o=a,a=h),l[t+1]>l[i+1]&&(h=t,t=i,i=h,h=s,s=o,o=h);let f=(l[t]+e.offsetX)*e.scaleX,p=(l[t+1]+e.offsetY)*e.scaleY,g=(l[i]+e.offsetX)*e.scaleX,v=(l[i+1]+e.offsetY)*e.scaleY,m=(l[r]+e.offsetX)*e.scaleX,y=(l[r+1]+e.offsetY)*e.scaleY;if(p>=y)return;let b=c[s],w=c[s+1],E=c[s+2],S=c[o],I=c[o+1],M=c[o+2],_=c[a],C=c[a+1],R=c[a+2],ge=Math.round(p),he=Math.round(y),le,Ee,Ve,H,ne,Di,Xi,en;for(let rt=ge;rt<=he;rt++){if(rty?Ne=1:v===y?Ne=0:Ne=(v-rt)/(v-y),le=g-(g-m)*Ne,Ee=S-(S-_)*Ne,Ve=I-(I-C)*Ne,H=M-(M-R)*Ne}let Ye;rty?Ye=1:Ye=(p-rt)/(p-y),ne=f-(f-m)*Ye,Di=b-(b-_)*Ye,Xi=w-(w-C)*Ye,en=E-(E-R)*Ye;let $r=Math.round(Math.min(le,ne)),co=Math.round(Math.max(le,ne)),tn=d*rt+$r*4;for(let Ne=$r;Ne<=co;Ne++)Ye=(le-Ne)/(le-ne),Ye<0?Ye=0:Ye>1&&(Ye=1),u[tn++]=Ee-(Ee-Di)*Ye|0,u[tn++]=Ve-(Ve-Xi)*Ye|0,u[tn++]=H-(H-en)*Ye|0,u[tn++]=255}}function VL(n,e,t){let i=e.coords,r=e.colors,s,o;switch(e.type){case"lattice":let a=e.verticesPerRow,l=Math.floor(i.length/a)-1,c=a-1;for(s=0;s{class n{static MAX_PATTERN_SIZE=3e3;constructor(t,i,r,s,o){this.operatorList=t[2],this.matrix=t[3],this.bbox=t[4],this.xstep=t[5],this.ystep=t[6],this.paintType=t[7],this.tilingType=t[8],this.color=i,this.ctx=r,this.canvasGraphicsFactory=s,this.baseTransform=o}createPatternCanvas(t){let{bbox:i,operatorList:r,paintType:s,tilingType:o,color:a,canvasGraphicsFactory:l}=this,{xstep:c,ystep:u}=this;c=Math.abs(c),u=Math.abs(u),fh("TilingType: "+o);let d=i[0],h=i[1],f=i[2],p=i[3],g=f-d,v=p-h,m=B.singularValueDecompose2dScale(this.matrix),y=B.singularValueDecompose2dScale(this.baseTransform),b=m[0]*y[0],w=m[1]*y[1],E=g,S=v,I=!1,M=!1,_=Math.ceil(c*b),C=Math.ceil(u*w),R=Math.ceil(g*b),ge=Math.ceil(v*w);_>=R?E=c:I=!0,C>=ge?S=u:M=!0;let he=this.getSizeAndScale(E,this.ctx.canvas.width,b),le=this.getSizeAndScale(S,this.ctx.canvas.height,w),Ee=t.cachedCanvases.getCanvas("pattern",he.size,le.size),Ve=Ee.context,H=l.createCanvasGraphics(Ve);if(H.groupLevel=t.groupLevel,this.setFillAndStrokeStyleToContext(H,s,a),Ve.translate(-he.scale*d,-le.scale*h),H.transform(he.scale,0,0,le.scale,0,0),Ve.save(),this.clipBbox(H,d,h,f,p),H.baseTransform=Le(H.ctx),H.executeOperatorList(r),H.endDrawing(),Ve.restore(),I||M){let ne=Ee.canvas;I&&(E=c),M&&(S=u);let Di=this.getSizeAndScale(E,this.ctx.canvas.width,b),Xi=this.getSizeAndScale(S,this.ctx.canvas.height,w),en=Di.size,rt=Xi.size,Ye=t.cachedCanvases.getCanvas("pattern-workaround",en,rt),$r=Ye.context,co=I?Math.floor(g/c):0,tn=M?Math.floor(v/u):0;for(let Ne=0;Ne<=co;Ne++)for(let Wn=0;Wn<=tn;Wn++)$r.drawImage(ne,en*Ne,rt*Wn,en,rt,0,0,en,rt);return{canvas:Ye.canvas,scaleX:Di.scale,scaleY:Xi.scale,offsetX:d,offsetY:h}}return{canvas:Ee.canvas,scaleX:he.scale,scaleY:le.scale,offsetX:d,offsetY:h}}getSizeAndScale(t,i,r){let s=Math.max(n.MAX_PATTERN_SIZE,i),o=Math.ceil(t*r);return o>=s?o=s:r=o/t,{scale:r,size:o}}clipBbox(t,i,r,s,o){let a=s-i,l=o-r;t.ctx.rect(i,r,a,l),t.current.updateRectMinMax(Le(t.ctx),[i,r,s,o]),t.clip(),t.endPath()}setFillAndStrokeStyleToContext(t,i,r){let s=t.ctx,o=t.current;switch(i){case mD.COLORED:let a=this.ctx;s.fillStyle=a.fillStyle,s.strokeStyle=a.strokeStyle,o.fillColor=a.fillStyle,o.strokeColor=a.strokeStyle;break;case mD.UNCOLORED:let l=B.makeHexColor(r[0],r[1],r[2]);s.fillStyle=l,s.strokeStyle=l,o.fillColor=l,o.strokeColor=l;break;default:throw new nv(`Unsupported paint type: ${i}`)}}getPattern(t,i,r,s){let o=r;s!==It.SHADING&&(o=B.transform(o,i.baseTransform),this.matrix&&(o=B.transform(o,this.matrix)));let a=this.createPatternCanvas(i),l=new DOMMatrix(o);l=l.translate(a.offsetX,a.offsetY),l=l.scale(1/a.scaleX,1/a.scaleY);let c=t.createPattern(a.canvas,"repeat");return c.setTransform(l),c}}return n})();function UL({src:n,srcPos:e=0,dest:t,width:i,height:r,nonBlackColor:s=4294967295,inverseDecode:o=!1}){let a=pt.isLittleEndian?4278190080:255,[l,c]=o?[s,a]:[a,s],u=i>>3,d=i&7,h=n.length;t=new Uint32Array(t.buffer);let f=0;for(let p=0;p{n.save=n.__originalSave,n.restore=n.__originalRestore,n.rotate=n.__originalRotate,n.scale=n.__originalScale,n.translate=n.__originalTranslate,n.transform=n.__originalTransform,n.setTransform=n.__originalSetTransform,n.resetTransform=n.__originalResetTransform,n.clip=n.__originalClip,n.moveTo=n.__originalMoveTo,n.lineTo=n.__originalLineTo,n.bezierCurveTo=n.__originalBezierCurveTo,n.rect=n.__originalRect,n.closePath=n.__originalClosePath,n.beginPath=n.__originalBeginPath,delete n._removeMirroring},n.save=function(){e.save(),this.__originalSave()},n.restore=function(){e.restore(),this.__originalRestore()},n.translate=function(i,r){e.translate(i,r),this.__originalTranslate(i,r)},n.scale=function(i,r){e.scale(i,r),this.__originalScale(i,r)},n.transform=function(i,r,s,o,a,l){e.transform(i,r,s,o,a,l),this.__originalTransform(i,r,s,o,a,l)},n.setTransform=function(i,r,s,o,a,l){e.setTransform(i,r,s,o,a,l),this.__originalSetTransform(i,r,s,o,a,l)},n.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},n.rotate=function(i){e.rotate(i),this.__originalRotate(i)},n.clip=function(i){e.clip(i),this.__originalClip(i)},n.moveTo=function(t,i){e.moveTo(t,i),this.__originalMoveTo(t,i)},n.lineTo=function(t,i){e.lineTo(t,i),this.__originalLineTo(t,i)},n.bezierCurveTo=function(t,i,r,s,o,a){e.bezierCurveTo(t,i,r,s,o,a),this.__originalBezierCurveTo(t,i,r,s,o,a)},n.rect=function(t,i,r,s){e.rect(t,i,r,s),this.__originalRect(t,i,r,s)},n.closePath=function(){e.closePath(),this.__originalClosePath()},n.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}var Cv=class{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,t,i){let r;return this.cache[e]!==void 0?(r=this.cache[e],this.canvasFactory.reset(r,t,i)):(r=this.canvasFactory.create(t,i),this.cache[e]=r),r}delete(e){delete this.cache[e]}clear(){for(let e in this.cache){let t=this.cache[e];this.canvasFactory.destroy(t),delete this.cache[e]}}};function Ad(n,e,t,i,r,s,o,a,l,c){let[u,d,h,f,p,g]=Le(n);if(d===0&&h===0){let y=o*u+p,b=Math.round(y),w=a*f+g,E=Math.round(w),S=(o+l)*u+p,I=Math.abs(Math.round(S)-b)||1,M=(a+c)*f+g,_=Math.abs(Math.round(M)-E)||1;return n.setTransform(Math.sign(u),0,0,Math.sign(f),b,E),n.drawImage(e,t,i,r,s,0,0,I,_),n.setTransform(u,d,h,f,p,g),[I,_]}if(u===0&&f===0){let y=a*h+p,b=Math.round(y),w=o*d+g,E=Math.round(w),S=(a+c)*h+p,I=Math.abs(Math.round(S)-b)||1,M=(o+l)*d+g,_=Math.abs(Math.round(M)-E)||1;return n.setTransform(0,Math.sign(d),Math.sign(h),0,b,E),n.drawImage(e,t,i,r,s,0,0,_,I),n.setTransform(u,d,h,f,p,g),[_,I]}n.drawImage(e,t,i,r,s,o,a,l,c);let v=Math.hypot(u,d),m=Math.hypot(h,f);return[v*l,m*c]}function zL(n){let{width:e,height:t}=n;if(e>wD||t>wD)return null;let i=1e3,r=new Uint8Array([0,2,4,0,1,0,5,4,8,10,0,8,0,2,1,0]),s=e+1,o=new Uint8Array(s*(t+1)),a,l,c,u=e+7&-8,d=new Uint8Array(u*t),h=0;for(let m of n.data){let y=128;for(;y>0;)d[h++]=m&y?0:255,y>>=1}let f=0;for(h=0,d[h]!==0&&(o[0]=1,++f),l=1;l>2)+(d[h+1]?4:0)+(d[h-u+1]?8:0),r[m]&&(o[c+l]=r[m],++f),h++;if(d[h-u]!==d[h]&&(o[c+l]=d[h]?2:4,++f),f>i)return null}for(h=u*(t-1),c=a*s,d[h]!==0&&(o[c]=8,++f),l=1;li)return null;let p=new Int32Array([0,s,-1,0,-s,0,0,0,1]),g=new Path2D;for(a=0;f&&a<=t;a++){let m=a*s,y=m+e;for(;m>4,o[m]&=w>>2|w<<2),g.lineTo(m%s,m/s|0),o[m]||--f}while(b!==m);--a}return d=null,o=null,function(m){m.save(),m.scale(1/e,-1/t),m.translate(0,-t),m.fill(g),m.beginPath(),m.restore()}}var Wd=class{constructor(e,t){this.alphaIsShape=!1,this.fontSize=0,this.fontSizeScale=1,this.textMatrix=xD,this.textMatrixScale=1,this.fontMatrix=tv,this.leading=0,this.x=0,this.y=0,this.lineX=0,this.lineY=0,this.charSpacing=0,this.wordSpacing=0,this.textHScale=1,this.textRenderingMode=_t.FILL,this.textRise=0,this.fillColor="#000000",this.strokeColor="#000000",this.patternFill=!1,this.fillAlpha=1,this.strokeAlpha=1,this.lineWidth=1,this.activeSMask=null,this.transferMaps="none",this.startNewPathAndClipBox([0,0,e,t])}clone(){let e=Object.create(this);return e.clipBox=this.clipBox.slice(),e}setCurrentPoint(e,t){this.x=e,this.y=t}updatePathMinMax(e,t,i){[t,i]=B.applyTransform([t,i],e),this.minX=Math.min(this.minX,t),this.minY=Math.min(this.minY,i),this.maxX=Math.max(this.maxX,t),this.maxY=Math.max(this.maxY,i)}updateRectMinMax(e,t){let i=B.applyTransform(t,e),r=B.applyTransform(t.slice(2),e),s=B.applyTransform([t[0],t[3]],e),o=B.applyTransform([t[2],t[1]],e);this.minX=Math.min(this.minX,i[0],r[0],s[0],o[0]),this.minY=Math.min(this.minY,i[1],r[1],s[1],o[1]),this.maxX=Math.max(this.maxX,i[0],r[0],s[0],o[0]),this.maxY=Math.max(this.maxY,i[1],r[1],s[1],o[1])}updateScalingPathMinMax(e,t){B.scaleMinMax(e,t),this.minX=Math.min(this.minX,t[0]),this.minY=Math.min(this.minY,t[1]),this.maxX=Math.max(this.maxX,t[2]),this.maxY=Math.max(this.maxY,t[3])}updateCurvePathMinMax(e,t,i,r,s,o,a,l,c,u){let d=B.bezierBoundingBox(t,i,r,s,o,a,l,c,u);u||this.updateRectMinMax(e,d)}getPathBoundingBox(e=It.FILL,t=null){let i=[this.minX,this.minY,this.maxX,this.maxY];if(e===It.STROKE){t||Pe("Stroke bounding box must include transform.");let r=B.singularValueDecompose2dScale(t),s=r[0]*this.lineWidth/2,o=r[1]*this.lineWidth/2;i[0]-=s,i[1]-=o,i[2]+=s,i[3]+=o}return i}updateClipFromPath(){let e=B.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minX===1/0}startNewPathAndClipBox(e){this.clipBox=e,this.minX=1/0,this.minY=1/0,this.maxX=0,this.maxY=0}getClippedPathBoundingBox(e=It.FILL,t=null){return B.intersect(this.clipBox,this.getPathBoundingBox(e,t))}};function _D(n,e){if(typeof ImageData<"u"&&e instanceof ImageData){n.putImageData(e,0,0);return}let t=e.height,i=e.width,r=t%Bt,s=(t-r)/Bt,o=r===0?s:s+1,a=n.createImageData(i,Bt),l=0,c,u=e.data,d=a.data,h,f,p,g;if(e.kind===Md.GRAYSCALE_1BPP){let v=u.byteLength,m=new Uint32Array(d.buffer,0,d.byteLength>>2),y=m.length,b=i+7>>3,w=4294967295,E=pt.isLittleEndian?4278190080:255;for(h=0;hb?i:S*8-7,_=M&-8,C=0,R=0;for(;I<_;I+=8)R=u[l++],m[c++]=R&128?w:E,m[c++]=R&64?w:E,m[c++]=R&32?w:E,m[c++]=R&16?w:E,m[c++]=R&8?w:E,m[c++]=R&4?w:E,m[c++]=R&2?w:E,m[c++]=R&1?w:E;for(;I>=1}for(;c=s&&(p=r,g=i*p),c=0,f=g;f--;)d[c++]=u[l++],d[c++]=u[l++],d[c++]=u[l++],d[c++]=255;n.putImageData(a,0,h*Bt)}else throw new Error(`bad image kind: ${e.kind}`)}function ED(n,e){if(e.bitmap){n.drawImage(e.bitmap,0,0);return}let t=e.height,i=e.width,r=t%Bt,s=(t-r)/Bt,o=r===0?s:s+1,a=n.createImageData(i,Bt),l=0,c=e.data,u=a.data;for(let d=0;dbD&&typeof i=="function",u=c?Date.now()+HL:0,d=0,h=this.commonObjs,f=this.objs,p;for(;;){if(r!==void 0&&a===r.nextBreakPoint)return r.breakIt(a,i),a;if(p=o[a],p!==An.dependency)this[p].apply(this,s[a]);else for(let g of s[a]){let v=g.startsWith("g_")?h:f;if(!v.has(g))return v.get(g,i),a}if(a++,a===l)return a;if(c&&++d>bD){if(Date.now()>u)return i(),a;d=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(let e of this._cachedBitmapsMap.values()){for(let t of e.values())typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){let e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){let t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){let i=e.width??e.displayWidth,r=e.height??e.displayHeight,s=Math.max(Math.hypot(t[0],t[1]),1),o=Math.max(Math.hypot(t[2],t[3]),1),a=i,l=r,c="prescale1",u,d;for(;s>2&&a>1||o>2&&l>1;){let h=a,f=l;s>2&&a>1&&(h=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),s/=a/h),o>2&&l>1&&(f=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,o/=l/f),u=this.cachedCanvases.getCanvas(c,h,f),d=u.context,d.clearRect(0,0,h,f),d.drawImage(e,0,0,a,l,0,0,h,f),e=u.canvas,a=h,l=f,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:a,paintHeight:l}}_createMaskCanvas(e){let t=this.ctx,{width:i,height:r}=e,s=this.current.fillColor,o=this.current.patternFill,a=Le(t),l,c,u,d;if((e.bitmap||e.data)&&e.count>1){let M=e.bitmap||e.data.buffer;c=JSON.stringify(o?a:[a.slice(0,4),s]),l=this._cachedBitmapsMap.get(M),l||(l=new Map,this._cachedBitmapsMap.set(M,l));let _=l.get(c);if(_&&!o){let C=Math.round(Math.min(a[0],a[2])+a[4]),R=Math.round(Math.min(a[1],a[3])+a[5]);return{canvas:_,offsetX:C,offsetY:R}}u=_}u||(d=this.cachedCanvases.getCanvas("maskCanvas",i,r),ED(d.context,e));let h=B.transform(a,[1/i,0,0,-1/r,0,0]);h=B.transform(h,[1,0,0,1,0,-r]);let[f,p,g,v]=B.getAxialAlignedBoundingBox([0,0,i,r],h),m=Math.round(g-f)||1,y=Math.round(v-p)||1,b=this.cachedCanvases.getCanvas("fillCanvas",m,y),w=b.context,E=f,S=p;w.translate(-E,-S),w.transform(...h),u||(u=this._scaleImage(d.canvas,vi(w)),u=u.img,l&&o&&l.set(c,u)),w.imageSmoothingEnabled=CD(Le(w),e.interpolate),Ad(w,u,0,0,u.width,u.height,0,0,i,r),w.globalCompositeOperation="source-in";let I=B.transform(vi(w),[1,0,0,1,-E,-S]);return w.fillStyle=o?s.getPattern(t,this,I,It.FILL):s,w.fillRect(0,0,i,r),l&&!o&&(this.cachedCanvases.delete("fillCanvas"),l.set(c,b.canvas)),{canvas:b.canvas,offsetX:Math.round(E),offsetY:Math.round(S)}}setLineWidth(e){e!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=e,this.ctx.lineWidth=e}setLineCap(e){this.ctx.lineCap=WL[e]}setLineJoin(e){this.ctx.lineJoin=GL[e]}setMiterLimit(e){this.ctx.miterLimit=e}setDash(e,t){let i=this.ctx;i.setLineDash!==void 0&&(i.setLineDash(e),i.lineDashOffset=t)}setRenderingIntent(e){}setFlatness(e){}setGState(e){for(let[t,i]of e)switch(t){case"LW":this.setLineWidth(i);break;case"LC":this.setLineCap(i);break;case"LJ":this.setLineJoin(i);break;case"ML":this.setMiterLimit(i);break;case"D":this.setDash(i[0],i[1]);break;case"RI":this.setRenderingIntent(i);break;case"FL":this.setFlatness(i);break;case"Font":this.setFont(i[0],i[1]);break;case"CA":this.current.strokeAlpha=i;break;case"ca":this.current.fillAlpha=i,this.ctx.globalAlpha=i;break;case"BM":this.ctx.globalCompositeOperation=i;break;case"SMask":this.current.activeSMask=i?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(i);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){let e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");let e=this.ctx.canvas.width,t=this.ctx.canvas.height,i="smaskGroupAt"+this.groupLevel,r=this.cachedCanvases.getCanvas(i,e,t);this.suspendedCtx=this.ctx,this.ctx=r.context;let s=this.ctx;s.setTransform(...Le(this.suspendedCtx)),Ha(this.suspendedCtx,s),$L(s,this.suspendedCtx),this.setGState([["BM","source-over"],["ca",1],["CA",1]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Ha(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let t=this.current.activeSMask,i=this.suspendedCtx;this.composeSMask(i,t,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,t,i,r){let s=r[0],o=r[1],a=r[2]-s,l=r[3]-o;a===0||l===0||(this.genericComposeSMask(t.context,i,a,l,t.subtype,t.backdrop,t.transferMap,s,o,t.offsetX,t.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(i.canvas,0,0),e.restore())}genericComposeSMask(e,t,i,r,s,o,a,l,c,u,d){let h=e.canvas,f=l-u,p=c-d;if(o){let v=B.makeHexColor(...o);if(f<0||p<0||f+i>h.width||p+r>h.height){let m=this.cachedCanvases.getCanvas("maskExtension",i,r),y=m.context;y.drawImage(h,-f,-p),y.globalCompositeOperation="destination-atop",y.fillStyle=v,y.fillRect(0,0,i,r),y.globalCompositeOperation="source-over",h=m.canvas,f=p=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);let m=new Path2D;m.rect(f,p,i,r),e.clip(m),e.globalCompositeOperation="destination-atop",e.fillStyle=v,e.fillRect(f,p,i,r),e.restore()}}t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0),s==="Alpha"&&a?t.filter=this.filterFactory.addAlphaFilter(a):s==="Luminosity"&&(t.filter=this.filterFactory.addLuminosityFilter(a));let g=new Path2D;g.rect(l,c,i,r),t.clip(g),t.globalCompositeOperation="destination-in",t.drawImage(h,f,p,i,r,l,c,i,r),t.restore()}save(){this.inSMaskMode?(Ha(this.ctx,this.suspendedCtx),this.suspendedCtx.save()):this.ctx.save();let e=this.current;this.stateStack.push(e),this.current=e.clone()}restore(){this.stateStack.length===0&&this.inSMaskMode&&this.endSMaskMode(),this.stateStack.length!==0&&(this.current=this.stateStack.pop(),this.inSMaskMode?(this.suspendedCtx.restore(),Ha(this.suspendedCtx,this.ctx)):this.ctx.restore(),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null)}transform(e,t,i,r,s,o){this.ctx.transform(e,t,i,r,s,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,i){let r=this.ctx,s=this.current,o=s.x,a=s.y,l,c,u=Le(r),d=u[0]===0&&u[3]===0||u[1]===0&&u[2]===0,h=d?i.slice(0):null;for(let f=0,p=0,g=e.length;fyD&&(c=yD),this.current.fontSizeScale=t/c,this.ctx.font=`${l} ${a} ${c}px ${o}`}setTextRenderingMode(e){this.current.textRenderingMode=e}setTextRise(e){this.current.textRise=e}moveText(e,t){this.current.x=this.current.lineX+=e,this.current.y=this.current.lineY+=t}setLeadingMoveText(e,t){this.setLeading(-t),this.moveText(e,t)}setTextMatrix(e,t,i,r,s,o){this.current.textMatrix=[e,t,i,r,s,o],this.current.textMatrixScale=Math.hypot(e,t),this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0}nextLine(){this.moveText(0,this.current.leading)}paintChar(e,t,i,r){let s=this.ctx,o=this.current,a=o.font,l=o.textRenderingMode,c=o.fontSize/o.fontSizeScale,u=l&_t.FILL_STROKE_MASK,d=!!(l&_t.ADD_TO_PATH_FLAG),h=o.patternFill&&!a.missingFile,f;(a.disableFontFace||d||h)&&(f=a.getPathGenerator(this.commonObjs,e)),a.disableFontFace||h?(s.save(),s.translate(t,i),s.beginPath(),f(s,c),r&&s.setTransform(...r),(u===_t.FILL||u===_t.FILL_STROKE)&&s.fill(),(u===_t.STROKE||u===_t.FILL_STROKE)&&s.stroke(),s.restore()):((u===_t.FILL||u===_t.FILL_STROKE)&&s.fillText(e,t,i),(u===_t.STROKE||u===_t.FILL_STROKE)&&s.strokeText(e,t,i)),d&&(this.pendingTextPaths||=[]).push({transform:Le(s),x:t,y:i,fontSize:c,addToPath:f})}get isFontSubpixelAAEnabled(){let{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);let t=e.getImageData(0,0,10,10).data,i=!1;for(let r=3;r0&&t[r]<255){i=!0;break}return de(this,"isFontSubpixelAAEnabled",i)}showText(e){let t=this.current,i=t.font;if(i.isType3Font)return this.showType3Text(e);let r=t.fontSize;if(r===0)return;let s=this.ctx,o=t.fontSizeScale,a=t.charSpacing,l=t.wordSpacing,c=t.fontDirection,u=t.textHScale*c,d=e.length,h=i.vertical,f=h?1:-1,p=i.defaultVMetrics,g=r*t.fontMatrix[0],v=t.textRenderingMode===_t.FILL&&!i.disableFontFace&&!t.patternFill;s.save(),s.transform(...t.textMatrix),s.translate(t.x,t.y+t.textRise),c>0?s.scale(u,-1):s.scale(u,1);let m;if(t.patternFill){s.save();let S=t.fillColor.getPattern(s,this,vi(s),It.FILL);m=Le(s),s.restore(),s.fillStyle=S}let y=t.lineWidth,b=t.textMatrixScale;if(b===0||y===0){let S=t.textRenderingMode&_t.FILL_STROKE_MASK;(S===_t.STROKE||S===_t.FILL_STROKE)&&(y=this.getSinglePixelWidth())}else y/=b;if(o!==1&&(s.scale(o,o),y/=o),s.lineWidth=y,i.isInvalidPDFjsFont){let S=[],I=0;for(let M of e)S.push(M.unicode),I+=M.width;s.fillText(S.join(""),0,0),t.x+=I*g*u,s.restore(),this.compose();return}let w=0,E;for(E=0;E0){let Ee=s.measureText(_).width*1e3/r*o;if(henew n(o,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack})};t=new BL(e,i,this.ctx,s,r)}else t=this._getPattern(e[1],e[2]);return t}setStrokeColorN(){this.current.strokeColor=this.getColorN_Pattern(arguments)}setFillColorN(){this.current.fillColor=this.getColorN_Pattern(arguments),this.current.patternFill=!0}setStrokeRGBColor(e,t,i){this.ctx.strokeStyle=this.current.strokeColor=B.makeHexColor(e,t,i)}setStrokeTransparent(){this.ctx.strokeStyle=this.current.strokeColor="transparent"}setFillRGBColor(e,t,i){this.ctx.fillStyle=this.current.fillColor=B.makeHexColor(e,t,i),this.current.patternFill=!1}setFillTransparent(){this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,t=null){let i;return this.cachedPatterns.has(e)?i=this.cachedPatterns.get(e):(i=jL(this.getObject(e)),this.cachedPatterns.set(e,i)),t&&(i.matrix=t),i}shadingFill(e){if(!this.contentVisible)return;let t=this.ctx;this.save();let i=this._getPattern(e);t.fillStyle=i.getPattern(t,this,vi(t),It.SHADING);let r=vi(t);if(r){let{width:s,height:o}=t.canvas,[a,l,c,u]=B.getAxialAlignedBoundingBox([0,0,s,o],r);this.ctx.fillRect(a,l,c-a,u-l)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.compose(this.current.getClippedPathBoundingBox()),this.restore()}beginInlineImage(){Pe("Should not call beginInlineImage")}beginImageData(){Pe("Should not call beginImageData")}paintFormXObjectBegin(e,t){if(this.contentVisible&&(this.save(),this.baseTransformStack.push(this.baseTransform),e&&this.transform(...e),this.baseTransform=Le(this.ctx),t)){let i=t[2]-t[0],r=t[3]-t[1];this.ctx.rect(t[0],t[1],i,r),this.current.updateRectMinMax(Le(this.ctx),t),this.clip(),this.endPath()}}paintFormXObjectEnd(){this.contentVisible&&(this.restore(),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e){if(!this.contentVisible)return;this.save(),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);let t=this.ctx;e.isolated||fh("TODO: Support non-isolated groups."),e.knockout&&ie("Knockout groups not supported.");let i=Le(t);if(e.matrix&&t.transform(...e.matrix),!e.bbox)throw new Error("Bounding box is required.");let r=B.getAxialAlignedBoundingBox(e.bbox,Le(t)),s=[0,0,t.canvas.width,t.canvas.height];r=B.intersect(r,s)||[0,0,0,0];let o=Math.floor(r[0]),a=Math.floor(r[1]),l=Math.max(Math.ceil(r[2])-o,1),c=Math.max(Math.ceil(r[3])-a,1);this.current.startNewPathAndClipBox([0,0,l,c]);let u="groupAt"+this.groupLevel;e.smask&&(u+="_smask_"+this.smaskCounter++%2);let d=this.cachedCanvases.getCanvas(u,l,c),h=d.context;h.translate(-o,-a),h.transform(...i),e.smask?this.smaskStack.push({canvas:d.canvas,context:h,offsetX:o,offsetY:a,subtype:e.smask.subtype,backdrop:e.smask.backdrop,transferMap:e.smask.transferMap||null,startTransformInverse:null}):(t.setTransform(1,0,0,1,0,0),t.translate(o,a),t.save()),Ha(t,h),this.ctx=h,this.setGState([["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(t),this.groupLevel++}endGroup(e){if(!this.contentVisible)return;this.groupLevel--;let t=this.ctx,i=this.groupStack.pop();if(this.ctx=i,this.ctx.imageSmoothingEnabled=!1,e.smask)this.tempSMask=this.smaskStack.pop(),this.restore();else{this.ctx.restore();let r=Le(this.ctx);this.restore(),this.ctx.save(),this.ctx.setTransform(...r);let s=B.getAxialAlignedBoundingBox([0,0,t.canvas.width,t.canvas.height],r);this.ctx.drawImage(t.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(e,t,i,r,s){if(this.#e(),Dd(this.ctx),this.ctx.save(),this.save(),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),t){let o=t[2]-t[0],a=t[3]-t[1];if(s&&this.annotationCanvasMap){i=i.slice(),i[4]-=t[0],i[5]-=t[1],t=t.slice(),t[0]=t[1]=0,t[2]=o,t[3]=a;let[l,c]=B.singularValueDecompose2dScale(Le(this.ctx)),{viewportScale:u}=this,d=Math.ceil(o*this.outputScaleX*u),h=Math.ceil(a*this.outputScaleY*u);this.annotationCanvas=this.canvasFactory.create(d,h);let{canvas:f,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(e,f),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(l,0,0,-c,0,a*c),Dd(this.ctx)}else Dd(this.ctx),this.endPath(),this.ctx.rect(t[0],t[1],o,a),this.ctx.clip(),this.ctx.beginPath()}this.current=new Wd(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(...i),this.transform(...r)}endAnnotation(){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e){if(!this.contentVisible)return;let t=e.count;e=this.getObject(e.data,e),e.count=t;let i=this.ctx,r=this.processingType3;if(r&&(r.compiled===void 0&&(r.compiled=zL(e)),r.compiled)){r.compiled(i);return}let s=this._createMaskCanvas(e),o=s.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(o,s.offsetX,s.offsetY),i.restore(),this.compose()}paintImageMaskXObjectRepeat(e,t,i=0,r=0,s,o){if(!this.contentVisible)return;e=this.getObject(e.data,e);let a=this.ctx;a.save();let l=Le(a);a.transform(t,i,r,s,0,0);let c=this._createMaskCanvas(e);a.setTransform(1,0,0,1,c.offsetX-l[4],c.offsetY-l[5]);for(let u=0,d=o.length;ud?u/d:1,a=c>d?c/d:1}}this._cachedScaleForStroking[0]=o,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(e){let{ctx:t}=this,{lineWidth:i}=this.current,[r,s]=this.getScaleForStroking();if(t.lineWidth=i||1,r===1&&s===1){t.stroke();return}let o=t.getLineDash();if(e&&t.save(),t.scale(r,s),o.length>0){let a=Math.max(r,s);t.setLineDash(o.map(l=>l/a)),t.lineDashOffset/=a}t.stroke(),e&&t.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};for(let n in An)to.prototype[n]!==void 0&&(to.prototype[An[n]]=to.prototype[n]);var Or=class{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");this.#t=e}},Sd={UNKNOWN:0,DATA:1,ERROR:2},Qe={UNKNOWN:0,CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function Zt(n){switch(n instanceof Error||typeof n=="object"&&n!==null||Pe('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),n.name){case"AbortException":return new _i(n.message);case"MissingPDFException":return new wi(n.message);case"PasswordException":return new Ga(n.message,n.code);case"UnexpectedResponseException":return new io(n.message,n.status);case"UnknownErrorException":return new qa(n.message,n.details);default:return new qa(n.message,n.toString())}}var kr=class{#e=new AbortController;constructor(e,t,i){this.sourceName=e,this.targetName=t,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),i.addEventListener("message",this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#i(e);return}if(e.callback){let i=e.callbackId,r=this.callbackCapabilities[i];if(!r)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],e.callback===Sd.DATA)r.resolve(e.data);else if(e.callback===Sd.ERROR)r.reject(Zt(e.reason));else throw new Error("Unexpected callback case");return}let t=this.actionHandler[e.action];if(!t)throw new Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let i=this.sourceName,r=e.sourceName,s=this.comObj;new Promise(function(o){o(t(e.data))}).then(function(o){s.postMessage({sourceName:i,targetName:r,callback:Sd.DATA,callbackId:e.callbackId,data:o})},function(o){s.postMessage({sourceName:i,targetName:r,callback:Sd.ERROR,callbackId:e.callbackId,reason:Zt(o)})});return}if(e.streamId){this.#n(e);return}t(e.data)}on(e,t){let i=this.actionHandler;if(i[e])throw new Error(`There is already an actionName called "${e}"`);i[e]=t}send(e,t,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},i)}sendWithPromise(e,t,i){let r=this.callbackId++,s=Promise.withResolvers();this.callbackCapabilities[r]=s;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},i)}catch(o){s.reject(o)}return s.promise}sendWithStream(e,t,i,r){let s=this.streamId++,o=this.sourceName,a=this.targetName,l=this.comObj;return new ReadableStream({start:c=>{let u=Promise.withResolvers();return this.streamControllers[s]={controller:c,startCall:u,pullCall:null,cancelCall:null,isClosed:!1},l.postMessage({sourceName:o,targetName:a,action:e,streamId:s,data:t,desiredSize:c.desiredSize},r),u.promise},pull:c=>{let u=Promise.withResolvers();return this.streamControllers[s].pullCall=u,l.postMessage({sourceName:o,targetName:a,stream:Qe.PULL,streamId:s,desiredSize:c.desiredSize}),u.promise},cancel:c=>{it(c instanceof Error,"cancel must have a valid reason");let u=Promise.withResolvers();return this.streamControllers[s].cancelCall=u,this.streamControllers[s].isClosed=!0,l.postMessage({sourceName:o,targetName:a,stream:Qe.CANCEL,streamId:s,reason:Zt(c)}),u.promise}},i)}#n(e){let t=e.streamId,i=this.sourceName,r=e.sourceName,s=this.comObj,o=this,a=this.actionHandler[e.action],l={enqueue(c,u=1,d){if(this.isCancelled)return;let h=this.desiredSize;this.desiredSize-=u,h>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),s.postMessage({sourceName:i,targetName:r,stream:Qe.ENQUEUE,streamId:t,chunk:c},d)},close(){this.isCancelled||(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:r,stream:Qe.CLOSE,streamId:t}),delete o.streamSinks[t])},error(c){it(c instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,s.postMessage({sourceName:i,targetName:r,stream:Qe.ERROR,streamId:t,reason:Zt(c)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};l.sinkCapability.resolve(),l.ready=l.sinkCapability.promise,this.streamSinks[t]=l,new Promise(function(c){c(a(e.data,l))}).then(function(){s.postMessage({sourceName:i,targetName:r,stream:Qe.START_COMPLETE,streamId:t,success:!0})},function(c){s.postMessage({sourceName:i,targetName:r,stream:Qe.START_COMPLETE,streamId:t,reason:Zt(c)})})}#i(e){let t=e.streamId,i=this.sourceName,r=e.sourceName,s=this.comObj,o=this.streamControllers[t],a=this.streamSinks[t];switch(e.stream){case Qe.START_COMPLETE:e.success?o.startCall.resolve():o.startCall.reject(Zt(e.reason));break;case Qe.PULL_COMPLETE:e.success?o.pullCall.resolve():o.pullCall.reject(Zt(e.reason));break;case Qe.PULL:if(!a){s.postMessage({sourceName:i,targetName:r,stream:Qe.PULL_COMPLETE,streamId:t,success:!0});break}a.desiredSize<=0&&e.desiredSize>0&&a.sinkCapability.resolve(),a.desiredSize=e.desiredSize,new Promise(function(l){l(a.onPull?.())}).then(function(){s.postMessage({sourceName:i,targetName:r,stream:Qe.PULL_COMPLETE,streamId:t,success:!0})},function(l){s.postMessage({sourceName:i,targetName:r,stream:Qe.PULL_COMPLETE,streamId:t,reason:Zt(l)})});break;case Qe.ENQUEUE:if(it(o,"enqueue should have stream controller"),o.isClosed)break;o.controller.enqueue(e.chunk);break;case Qe.CLOSE:if(it(o,"close should have stream controller"),o.isClosed)break;o.isClosed=!0,o.controller.close(),this.#r(o,t);break;case Qe.ERROR:it(o,"error should have stream controller"),o.controller.error(Zt(e.reason)),this.#r(o,t);break;case Qe.CANCEL_COMPLETE:e.success?o.cancelCall.resolve():o.cancelCall.reject(Zt(e.reason)),this.#r(o,t);break;case Qe.CANCEL:if(!a)break;new Promise(function(l){l(a.onCancel?.(Zt(e.reason)))}).then(function(){s.postMessage({sourceName:i,targetName:r,stream:Qe.CANCEL_COMPLETE,streamId:t,success:!0})},function(l){s.postMessage({sourceName:i,targetName:r,stream:Qe.CANCEL_COMPLETE,streamId:t,reason:Zt(l)})}),a.sinkCapability.reject(Zt(e.reason)),a.isCancelled=!0,delete this.streamSinks[t];break;default:throw new Error("Unexpected stream case")}}#r(e,t){return A(this,null,function*(){yield Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]})}destroy(){this.#e?.abort(),this.#e=null}},Av=class{#e;#t;constructor({parsedData:e,rawData:t}){this.#e=e,this.#t=t}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}getAll(){return by(this.#e)}has(e){return this.#e.has(e)}},eo=Symbol("INTERNAL"),Dv=class{#e=!1;#t=!1;#n=!1;#i=!0;constructor(e,{name:t,intent:i,usage:r,rbGroups:s}){this.#e=!!(e&Qt.DISPLAY),this.#t=!!(e&Qt.PRINT),this.name=t,this.intent=i,this.usage=r,this.rbGroups=s}get visible(){if(this.#n)return this.#i;if(!this.#i)return!1;let{print:e,view:t}=this.usage;return this.#e?t?.viewState!=="OFF":this.#t?e?.printState!=="OFF":!0}_setVisible(e,t,i=!1){e!==eo&&Pe("Internal method `_setVisible` called."),this.#n=i,this.#i=t}},Sv=class{#e=null;#t=new Map;#n=null;#i=null;constructor(e,t=Qt.DISPLAY){if(this.renderingIntent=t,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,this.#i=e.order;for(let i of e.groups)this.#t.set(i.id,new Dv(t,i));if(e.baseState==="OFF")for(let i of this.#t.values())i._setVisible(eo,!1);for(let i of e.on)this.#t.get(i)._setVisible(eo,!0);for(let i of e.off)this.#t.get(i)._setVisible(eo,!1);this.#n=this.getHash()}}#r(e){let t=e.length;if(t<2)return!0;let i=e[0];for(let r=1;r0?by(this.#t):null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;let e=new Fd;for(let[t,i]of this.#t)e.update(`${t}:${i.visible}`);return this.#e=e.hexdigest()}},xv=class{constructor(e,{disableRange:t=!1,disableStream:i=!1}){it(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');let{length:r,initialData:s,progressiveDone:o,contentDispositionFilename:a}=e;if(this._queuedChunks=[],this._progressiveDone=o,this._contentDispositionFilename=a,s?.length>0){let l=s instanceof Uint8Array&&s.byteLength===s.buffer.byteLength?s.buffer:new Uint8Array(s).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!i,this._isRangeSupported=!t,this._contentLength=r,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),e.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:t}){let i=t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength?t.buffer:new Uint8Array(t).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(i):this._queuedChunks.push(i);else{let r=this._rangeReaders.some(function(s){return s._begin!==e?!1:(s._enqueue(i),!0)});it(r,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){let t=this._rangeReaders.indexOf(e);t>=0&&this._rangeReaders.splice(t,1)}getFullReader(){it(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");let e=this._queuedChunks;return this._queuedChunks=null,new Iv(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let i=new Tv(this,e,t);return this._pdfDataRangeTransport.requestDataRange(e,t),this._rangeReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeReaders.slice(0))t.cancel(e);this._pdfDataRangeTransport.abort()}},Iv=class{constructor(e,t,i=!1,r=null){this._stream=e,this._done=i||!1,this._filename=_y(r)?r:null,this._queuedChunks=t||[],this._loaded=0;for(let s of this._queuedChunks)this._loaded+=s.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}read(){return A(this,null,function*(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise})}cancel(e){this._done=!0;for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}},Tv=class{constructor(e,t,i){this._stream=e,this._begin=t,this._end=i,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(let i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}read(){return A(this,null,function*(){if(this._queuedChunk){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise})}cancel(e){this._done=!0;for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}};function YL(n){let e=!0,t=i("filename\\*","i").exec(n);if(t){t=t[1];let u=a(t);return u=unescape(u),u=l(u),u=c(u),s(u)}if(t=o(n),t){let u=c(t);return s(u)}if(t=i("filename","i").exec(n),t){t=t[1];let u=a(t);return u=c(u),s(u)}function i(u,d){return new RegExp("(?:^|;)\\s*"+u+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',d)}function r(u,d){if(u){if(!/^[\x00-\xFF]+$/.test(d))return d;try{let h=new TextDecoder(u,{fatal:!0}),f=ph(d);d=h.decode(f),e=!1}catch{}}return d}function s(u){return e&&/[\x80-\xff]/.test(u)&&(u=r("utf-8",u),e&&(u=r("iso-8859-1",u))),u}function o(u){let d=[],h,f=i("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(h=f.exec(u))!==null;){let[,g,v,m]=h;if(g=parseInt(g,10),g in d){if(g===0)break;continue}d[g]=[v,m]}let p=[];for(let g=0;g{if(!MD(s.status))throw vh(s.status,r);this._reader=s.body.getReader(),this._headersCapability.resolve();let o=s.headers,{allowRangeRequests:a,suggestedLength:l}=Ay({responseHeaders:o,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=l||this._contentLength,this._filename=Dy(o),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new _i("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}read(){return A(this,null,function*(){yield this._headersCapability.promise;let{value:e,done:t}=yield this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:PD(e),done:!1})})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},Rv=class{constructor(e,t,i){this._stream=e,this._reader=null,this._loaded=0;let r=e.source;this._withCredentials=r.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!r.disableStream,this._abortController=new AbortController;let s=new Headers(e.headers);s.append("Range",`bytes=${t}-${i-1}`);let o=r.url;fetch(o,RD(s,this._withCredentials,this._abortController)).then(a=>{if(!MD(a.status))throw vh(a.status,o);this._readCapability.resolve(),this._reader=a.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}read(){return A(this,null,function*(){yield this._readCapability.promise;let{value:e,done:t}=yield this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:PD(e),done:!1})})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},Jm=200,ev=206;function XL(n){let e=n.response;return typeof e!="string"?e:ph(e).buffer}var Pv=class{constructor({url:e,httpHeaders:t,withCredentials:i}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=Cy(this.isHttp,t),this.withCredentials=i||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}requestRange(e,t,i){let r={begin:e,end:t};for(let s in i)r[s]=i[s];return this.request(r)}requestFull(e){return this.request(e)}request(e){let t=new XMLHttpRequest,i=this.currXhrId++,r=this.pendingRequests[i]={xhr:t};t.open("GET",this.url),t.withCredentials=this.withCredentials;for(let[s,o]of this.headers)t.setRequestHeader(s,o);return this.isHttp&&"begin"in e&&"end"in e?(t.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),r.expectedStatus=ev):r.expectedStatus=Jm,t.responseType="arraybuffer",e.onError&&(t.onerror=function(s){e.onError(t.status)}),t.onreadystatechange=this.onStateChange.bind(this,i),t.onprogress=this.onProgress.bind(this,i),r.onHeadersReceived=e.onHeadersReceived,r.onDone=e.onDone,r.onError=e.onError,r.onProgress=e.onProgress,t.send(null),i}onProgress(e,t){let i=this.pendingRequests[e];i&&i.onProgress?.(t)}onStateChange(e,t){let i=this.pendingRequests[e];if(!i)return;let r=i.xhr;if(r.readyState>=2&&i.onHeadersReceived&&(i.onHeadersReceived(),delete i.onHeadersReceived),r.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],r.status===0&&this.isHttp){i.onError?.(r.status);return}let s=r.status||Jm;if(!(s===Jm&&i.expectedStatus===ev)&&s!==i.expectedStatus){i.onError?.(r.status);return}let a=XL(r);if(s===ev){let l=r.getResponseHeader("Content-Range"),c=/bytes (\d+)-(\d+)\/(\d+)/.exec(l);i.onDone({begin:parseInt(c[1],10),chunk:a})}else a?i.onDone({begin:0,chunk:a}):i.onError?.(r.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){let t=this.pendingRequests[e].xhr;delete this.pendingRequests[e],t.abort()}},Nv=class{constructor(e){this._source=e,this._manager=new Pv(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){let t=this._rangeRequestReaders.indexOf(e);t>=0&&this._rangeRequestReaders.splice(t,1)}getFullReader(){return it(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new kv(this._manager,this._source),this._fullRequestReader}getRangeReader(e,t){let i=new Ov(this._manager,e,t);return i.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},kv=class{constructor(e,t){this._manager=e;let i={onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=t.url,this._fullRequestId=e.requestFull(i),this._headersCapability=Promise.withResolvers(),this._disableRange=t.disableRange||!1,this._contentLength=t.length,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){let e=this._fullRequestId,t=this._manager.getRequestXhr(e),i=new Headers(t.getAllResponseHeaders().trim().split(/[\r\n]+/).map(o=>{let[a,...l]=o.split(": ");return[a,l.join(": ")]})),{allowRangeRequests:r,suggestedLength:s}=Ay({responseHeaders:i,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});r&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=Dy(i),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=vh(e,this._url),this._headersCapability.reject(this._storedError);for(let t of this._requests)t.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}read(){return A(this,null,function*(){if(this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise})}cancel(e){this._done=!0,this._headersCapability.reject(e);for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}},Ov=class{constructor(e,t,i){this._manager=e;let r={onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)};this._url=e.url,this._requestId=e.requestRange(t,i,r),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_close(){this.onClosed?.(this)}_onDone(e){let t=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:t,done:!1}):this._queuedChunk=t,this._done=!0;for(let i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError=vh(e,this._url);for(let t of this._requests)t.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}read(){return A(this,null,function*(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let t=this._queuedChunk;return this._queuedChunk=null,{value:t,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise})}cancel(e){this._done=!0;for(let t of this._requests)t.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}},KL=/^[a-z][a-z0-9\-+.]+:/i;function ZL(n){if(KL.test(n))return new URL(n);let e=Hn.get("url");return new URL(e.pathToFileURL(n))}function ND(n,e,t){return n.protocol==="http:"?Hn.get("http").request(n,{headers:e},t):Hn.get("https").request(n,{headers:e},t)}var Lv=class{constructor(e){this.source=e,this.url=ZL(e.url),this.isHttp=this.url.protocol==="http:"||this.url.protocol==="https:",this.isFsUrl=this.url.protocol==="file:",this.headers=Cy(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return it(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=this.isFsUrl?new jv(this):new Fv(this),this._fullRequestReader}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let i=this.isFsUrl?new Bv(this,e,t):new Vv(this,e,t);return this._rangeRequestReaders.push(i),i}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(let t of this._rangeRequestReaders.slice(0))t.cancel(e)}},qd=class{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;let t=e.source;this._contentLength=t.length,this._loaded=0,this._filename=null,this._disableRange=t.disableRange||!1,this._rangeChunkSize=t.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!t.disableStream,this._isRangeSupported=!t.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers()}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}read(){return A(this,null,function*(){if(yield this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new _i("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}},Yd=class{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();let t=e.source;this._isStreamingSupported=!t.disableStream}get isStreamingSupported(){return this._isStreamingSupported}read(){return A(this,null,function*(){if(yield this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;let e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",t=>{this._error(t)}),this._storedError&&this._readableStream.destroy(this._storedError)}},Fv=class extends qd{constructor(e){super(e);let t=Object.fromEntries(e.headers),i=r=>{if(r.statusCode===404){let l=new wi(`Missing PDF "${this._url}".`);this._storedError=l,this._headersCapability.reject(l);return}this._headersCapability.resolve(),this._setReadableStream(r);let s=new Headers(this._readableStream.headers),{allowRangeRequests:o,suggestedLength:a}=Ay({responseHeaders:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=o,this._contentLength=a||this._contentLength,this._filename=Dy(s)};this._request=ND(this._url,t,i),this._request.on("error",r=>{this._storedError=r,this._headersCapability.reject(r)}),this._request.end()}},Vv=class extends Yd{constructor(e,t,i){super(e);let r=Object.fromEntries(e.headers);r.Range=`bytes=${t}-${i-1}`;let s=o=>{if(o.statusCode===404){let a=new wi(`Missing PDF "${this._url}".`);this._storedError=a;return}this._setReadableStream(o)};this._request=ND(this._url,r,s),this._request.on("error",o=>{this._storedError=o}),this._request.end()}},jv=class extends qd{constructor(e){super(e);let t=Hn.get("fs");t.promises.lstat(this._url).then(i=>{this._contentLength=i.size,this._setReadableStream(t.createReadStream(this._url)),this._headersCapability.resolve()},i=>{i.code==="ENOENT"&&(i=new wi(`Missing PDF "${this._url}".`)),this._storedError=i,this._headersCapability.reject(i)})}},Bv=class extends Yd{constructor(e,t,i){super(e);let r=Hn.get("fs");this._setReadableStream(r.createReadStream(this._url,{start:t,end:i-1}))}},QL=1e5,jt=30,JL=.8,el=class n{#e=Promise.withResolvers();#t=null;#n=!1;#i=!!globalThis.FontInspector?.enabled;#r=null;#s=null;#l=0;#c=0;#u=null;#a=null;#d=0;#o=0;#h=Object.create(null);#p=[];#f=null;#g=[];#v=new WeakMap;#m=null;static#y=new Map;static#w=new Map;static#C=new WeakMap;static#_=null;static#E=new Set;constructor({textContentSource:e,container:t,viewport:i}){if(e instanceof ReadableStream)this.#f=e;else if(typeof e=="object")this.#f=new ReadableStream({start(l){l.enqueue(e),l.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#a=t,this.#o=i.scale*(globalThis.devicePixelRatio||1),this.#d=i.rotation,this.#s={div:null,properties:null,ctx:null};let{pageWidth:r,pageHeight:s,pageX:o,pageY:a}=i.rawDims;this.#m=[1,0,0,-1,-o,a+s],this.#c=r,this.#l=s,n.#R(),Lr(t,i),this.#e.promise.finally(()=>{n.#E.delete(this),this.#s=null,this.#h=null}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:e,isFirefox:t}=pt.platform;return de(this,"fontFamilyMap",new Map([["sans-serif",`${e&&t?"Calibri, ":""}sans-serif`],["monospace",`${e&&t?"Lucida Console, ":""}monospace`]]))}render(){let e=()=>{this.#u.read().then(({value:t,done:i})=>{if(i){this.#e.resolve();return}this.#r??=t.lang,Object.assign(this.#h,t.styles),this.#M(t.items),e()},this.#e.reject)};return this.#u=this.#f.getReader(),n.#E.add(this),e(),this.#e.promise}update({viewport:e,onBefore:t=null}){let i=e.scale*(globalThis.devicePixelRatio||1),r=e.rotation;if(r!==this.#d&&(t?.(),this.#d=r,Lr(this.#a,{rotation:r})),i!==this.#o){t?.(),this.#o=i;let s={div:null,properties:null,ctx:n.#I(this.#r)};for(let o of this.#g)s.properties=this.#v.get(o),s.div=o,this.#A(s)}}cancel(){let e=new _i("TextLayer task cancelled.");this.#u?.cancel(e).catch(()=>{}),this.#u=null,this.#e.reject(e)}get textDivs(){return this.#g}get textContentItemsStr(){return this.#p}#M(e){if(this.#n)return;this.#s.ctx??=n.#I(this.#r);let t=this.#g,i=this.#p;for(let r of e){if(t.length>QL){ie("Ignoring additional textDivs for performance reasons."),this.#n=!0;return}if(r.str===void 0){if(r.type==="beginMarkedContentProps"||r.type==="beginMarkedContent"){let s=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),r.id!==null&&this.#t.setAttribute("id",`${r.id}`),s.append(this.#t)}else r.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}i.push(r.str),this.#x(r)}}#x(e){let t=document.createElement("span"),i={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};this.#g.push(t);let r=B.transform(this.#m,e.transform),s=Math.atan2(r[1],r[0]),o=this.#h[e.fontName];o.vertical&&(s+=Math.PI/2);let a=this.#i&&o.fontSubstitution||o.fontFamily;a=n.fontFamilyMap.get(a)||a;let l=Math.hypot(r[2],r[3]),c=l*n.#N(a,this.#r),u,d;s===0?(u=r[4],d=r[5]-c):(u=r[4]+c*Math.sin(s),d=r[5]-c*Math.cos(s));let h="calc(var(--scale-factor)*",f=t.style;this.#t===this.#a?(f.left=`${(100*u/this.#c).toFixed(2)}%`,f.top=`${(100*d/this.#l).toFixed(2)}%`):(f.left=`${h}${u.toFixed(2)}px)`,f.top=`${h}${d.toFixed(2)}px)`),f.fontSize=`${h}${(n.#_*l).toFixed(2)}px)`,f.fontFamily=a,i.fontSize=l,t.setAttribute("role","presentation"),t.textContent=e.str,t.dir=e.dir,this.#i&&(t.dataset.fontName=o.fontSubstitutionLoadedName||e.fontName),s!==0&&(i.angle=s*(180/Math.PI));let p=!1;if(e.str.length>1)p=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){let g=Math.abs(e.transform[0]),v=Math.abs(e.transform[3]);g!==v&&Math.max(g,v)/Math.min(g,v)>1.5&&(p=!0)}if(p&&(i.canvasWidth=o.vertical?e.height:e.width),this.#v.set(t,i),this.#s.div=t,this.#s.properties=i,this.#A(this.#s),i.hasText&&this.#t.append(t),i.hasEOL){let g=document.createElement("br");g.setAttribute("role","presentation"),this.#t.append(g)}}#A(e){let{div:t,properties:i,ctx:r}=e,{style:s}=t,o="";if(n.#_>1&&(o=`scale(${1/n.#_})`),i.canvasWidth!==0&&i.hasText){let{fontFamily:a}=s,{canvasWidth:l,fontSize:c}=i;n.#S(r,c*this.#o,a);let{width:u}=r.measureText(t.textContent);u>0&&(o=`scaleX(${l*this.#o/u}) ${o}`)}i.angle!==0&&(o=`rotate(${i.angle}deg) ${o}`),o.length>0&&(s.transform=o)}static cleanup(){if(!(this.#E.size>0)){this.#y.clear();for(let{canvas:e}of this.#w.values())e.remove();this.#w.clear()}}static#I(e=null){let t=this.#w.get(e||="");if(!t){let i=document.createElement("canvas");i.className="hiddenCanvasElement",i.lang=e,document.body.append(i),t=i.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#w.set(e,t),this.#C.set(t,{size:0,family:""})}return t}static#S(e,t,i){let r=this.#C.get(e);t===r.size&&i===r.family||(e.font=`${t}px ${i}`,r.size=t,r.family=i)}static#R(){if(this.#_!==null)return;let e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),this.#_=e.getBoundingClientRect().height,e.remove()}static#N(e,t){let i=this.#y.get(e);if(i)return i;let r=this.#I(t);r.canvas.width=r.canvas.height=jt,this.#S(r,jt,e);let s=r.measureText(""),o=s.fontBoundingBoxAscent,a=Math.abs(s.fontBoundingBoxDescent);if(o){let u=o/(o+a);return this.#y.set(e,u),r.canvas.width=r.canvas.height=0,u}r.strokeStyle="red",r.clearRect(0,0,jt,jt),r.strokeText("g",0,0);let l=r.getImageData(0,0,jt,jt).data;a=0;for(let u=l.length-1-3;u>=0;u-=4)if(l[u]>0){a=Math.ceil(u/4/jt);break}r.clearRect(0,0,jt,jt),r.strokeText("A",0,jt),l=r.getImageData(0,0,jt,jt).data,o=0;for(let u=0,d=l.length;u0){o=jt-Math.floor(u/4/jt);break}r.canvas.width=r.canvas.height=0;let c=o?o/(o+a):JL;return this.#y.set(e,c),c}},tl=class n{static textContent(e){let t=[],i={items:t,styles:Object.create(null)};function r(s){if(!s)return;let o=null,a=s.name;if(a==="#text")o=s.value;else if(n.shouldBuildText(a))s?.attributes?.textContent?o=s.attributes.textContent:s.value&&(o=s.value);else return;if(o!==null&&t.push({str:o}),!!s.children)for(let l of s.children)r(l)}return r(e),i}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}},eF=65536,tF=100,nF=5e3,iF=Et?mv:fv,rF=Et?vv:Ud,sF=Et?gv:pv,oF=Et?yv:zd;function aF(n={}){typeof n=="string"||n instanceof URL?n={url:n}:(n instanceof ArrayBuffer||ArrayBuffer.isView(n))&&(n={data:n});let e=new Uv,{docId:t}=e,i=n.url?lF(n.url):null,r=n.data?cF(n.data):null,s=n.httpHeaders||null,o=n.withCredentials===!0,a=n.password??null,l=n.range instanceof Xd?n.range:null,c=Number.isInteger(n.rangeChunkSize)&&n.rangeChunkSize>0?n.rangeChunkSize:eF,u=n.worker instanceof no?n.worker:null,d=n.verbosity,h=typeof n.docBaseUrl=="string"&&!mh(n.docBaseUrl)?n.docBaseUrl:null,f=typeof n.cMapUrl=="string"?n.cMapUrl:null,p=n.cMapPacked!==!1,g=n.CMapReaderFactory||rF,v=typeof n.standardFontDataUrl=="string"?n.standardFontDataUrl:null,m=n.StandardFontDataFactory||oF,y=n.stopAtErrors!==!0,b=Number.isInteger(n.maxImageSize)&&n.maxImageSize>-1?n.maxImageSize:-1,w=n.isEvalSupported!==!1,E=typeof n.isOffscreenCanvasSupported=="boolean"?n.isOffscreenCanvasSupported:!Et,S=typeof n.isChrome=="boolean"?n.isChrome:!pt.platform.isFirefox&&typeof window<"u"&&!!window?.chrome,I=Number.isInteger(n.canvasMaxAreaInBytes)?n.canvasMaxAreaInBytes:-1,M=typeof n.disableFontFace=="boolean"?n.disableFontFace:Et,_=n.fontExtraProperties===!0,C=n.enableXfa===!0,R=n.ownerDocument||globalThis.document,ge=n.disableRange===!0,he=n.disableStream===!0,le=n.disableAutoFetch===!0,Ee=n.pdfBug===!0,Ve=n.CanvasFactory||iF,H=n.FilterFactory||sF,ne=n.enableHWA===!0,Di=l?l.length:n.length??NaN,Xi=typeof n.useSystemFonts=="boolean"?n.useSystemFonts:!Et&&!M,en=typeof n.useWorkerFetch=="boolean"?n.useWorkerFetch:g===Ud&&m===zd&&f&&v&&za(f,document.baseURI)&&za(v,document.baseURI);n.canvasFactory&&fD("`canvasFactory`-instance option, please use `CanvasFactory` instead."),n.filterFactory&&fD("`filterFactory`-instance option, please use `FilterFactory` instead.");let rt=null;EL(d);let Ye={canvasFactory:new Ve({ownerDocument:R,enableHWA:ne}),filterFactory:new H({docId:t,ownerDocument:R}),cMapReaderFactory:en?null:new g({baseUrl:f,isCompressed:p}),standardFontDataFactory:en?null:new m({baseUrl:v})};if(!u){let tn={verbosity:d,port:Or.workerPort};u=tn.port?no.fromPort(tn):new no(tn),e._worker=u}let $r={docId:t,apiVersion:"4.8.69",data:r,password:a,disableAutoFetch:le,rangeChunkSize:c,length:Di,docBaseUrl:h,enableXfa:C,evaluatorOptions:{maxImageSize:b,disableFontFace:M,ignoreErrors:y,isEvalSupported:w,isOffscreenCanvasSupported:E,isChrome:S,canvasMaxAreaInBytes:I,fontExtraProperties:_,useSystemFonts:Xi,cMapUrl:en?f:null,standardFontDataUrl:en?v:null}},co={disableFontFace:M,fontExtraProperties:_,ownerDocument:R,pdfBug:Ee,styleElement:rt,loadingParams:{disableAutoFetch:le,enableXfa:C}};return u.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");let tn=u.messageHandler.sendWithPromise("GetDocRequest",$r,r?[r.buffer]:null),Ne;if(l)Ne=new xv(l,{disableRange:ge,disableStream:he});else if(!r){if(!i)throw new Error("getDocument - no `url` parameter provided.");let Wn;Et?Wn=typeof fetch<"u"&&typeof Response<"u"&&"body"in Response.prototype&&za(i)?Gd:Lv:Wn=za(i)?Gd:Nv,Ne=new Wn({url:i,length:Di,httpHeaders:s,withCredentials:o,rangeChunkSize:c,disableRange:ge,disableStream:he})}return tn.then(Wn=>{if(e.destroyed)throw new Error("Loading aborted");if(u.destroyed)throw new Error("Worker was destroyed");let Gh=new kr(t,Wn,u.port),TS=new Wv(Gh,e,Ne,co,Ye);e._transport=TS,Gh.send("Ready",null)})}).catch(e._capability.reject),e}function lF(n){if(n instanceof URL)return n.href;try{return new URL(n,window.location).href}catch{if(Et&&typeof n=="string")return n}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function cF(n){if(Et&&typeof Buffer<"u"&&n instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength)return n;if(typeof n=="string")return ph(n);if(n instanceof ArrayBuffer||ArrayBuffer.isView(n)||typeof n=="object"&&!isNaN(n?.length))return new Uint8Array(n);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function DD(n){return typeof n=="object"&&Number.isInteger(n?.num)&&n.num>=0&&Number.isInteger(n?.gen)&&n.gen>=0}var Uv=class n{static#e=0;constructor(){this._capability=Promise.withResolvers(),this._transport=null,this._worker=null,this.docId=`d${n.#e++}`,this.destroyed=!1,this.onPassword=null,this.onProgress=null}get promise(){return this._capability.promise}destroy(){return A(this,null,function*(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),yield this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker&&(this._worker.destroy(),this._worker=null)})}},Xd=class{constructor(e,t,i=!1,r=null){this.length=e,this.initialData=t,this.progressiveDone=i,this.contentDispositionFilename=r,this._rangeListeners=[],this._progressListeners=[],this._progressiveReadListeners=[],this._progressiveDoneListeners=[],this._readyCapability=Promise.withResolvers()}addRangeListener(e){this._rangeListeners.push(e)}addProgressListener(e){this._progressListeners.push(e)}addProgressiveReadListener(e){this._progressiveReadListeners.push(e)}addProgressiveDoneListener(e){this._progressiveDoneListeners.push(e)}onDataRange(e,t){for(let i of this._rangeListeners)i(e,t)}onDataProgress(e,t){this._readyCapability.promise.then(()=>{for(let i of this._progressListeners)i(e,t)})}onDataProgressiveRead(e){this._readyCapability.promise.then(()=>{for(let t of this._progressiveReadListeners)t(e)})}onDataProgressiveDone(){this._readyCapability.promise.then(()=>{for(let e of this._progressiveDoneListeners)e()})}transportReady(){this._readyCapability.resolve()}requestDataRange(e,t){Pe("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}},Hv=class{constructor(e,t){this._pdfInfo=e,this._transport=t}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return de(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}},$v=class{#e=null;#t=!1;constructor(e,t,i,r=!1){this._pageIndex=e,this._pageInfo=t,this._transport=i,this._stats=r?new kd:null,this._pdfBug=r,this.commonObjs=i.commonObjs,this.objs=new Kd,this._maybeCleanupAfterRender=!1,this._intentStates=new Map,this.destroyed=!1}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:i=0,offsetY:r=0,dontFlip:s=!1}={}){return new Ya({viewBox:this.view,scale:e,rotation:t,offsetX:i,offsetY:r,dontFlip:s})}getAnnotations({intent:e="display"}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return de(this,"isPureXfa",!!this._transport._htmlForXfa)}getXfa(){return A(this,null,function*(){return this._transport._htmlForXfa?.children[this._pageIndex]||null})}render({canvasContext:e,viewport:t,intent:i="display",annotationMode:r=Wi.ENABLE,transform:s=null,background:o=null,optionalContentConfigPromise:a=null,annotationCanvasMap:l=null,pageColors:c=null,printAnnotationStorage:u=null,isEditing:d=!1}){this._stats?.time("Overall");let h=this._transport.getRenderingIntent(i,r,u,d),{renderingIntent:f,cacheKey:p}=h;this.#t=!1,this.#i(),a||=this._transport.getOptionalContentConfig(f);let g=this._intentStates.get(p);g||(g=Object.create(null),this._intentStates.set(p,g)),g.streamReaderCancelTimeout&&(clearTimeout(g.streamReaderCancelTimeout),g.streamReaderCancelTimeout=null);let v=!!(f&Qt.PRINT);g.displayReadyCapability||(g.displayReadyCapability=Promise.withResolvers(),g.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(h));let m=w=>{g.renderTasks.delete(y),(this._maybeCleanupAfterRender||v)&&(this.#t=!0),this.#n(!v),w?(y.capability.reject(w),this._abortOperatorList({intentState:g,reason:w instanceof Error?w:new Error(w)})):y.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},y=new qv({callback:m,params:{canvasContext:e,viewport:t,transform:s,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:l,operatorList:g.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!v,pdfBug:this._pdfBug,pageColors:c});(g.renderTasks||=new Set).add(y);let b=y.task;return Promise.all([g.displayReadyCapability.promise,a]).then(([w,E])=>{if(this.destroyed){m();return}if(this._stats?.time("Rendering"),!(E.renderingIntent&f))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");y.initializeGraphics({transparency:w,optionalContentConfig:E}),y.operatorListChanged()}).catch(m),b}getOperatorList({intent:e="display",annotationMode:t=Wi.ENABLE,printAnnotationStorage:i=null,isEditing:r=!1}={}){function s(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(l))}let o=this._transport.getRenderingIntent(e,t,i,r,!0),a=this._intentStates.get(o.cacheKey);a||(a=Object.create(null),this._intentStates.set(o.cacheKey,a));let l;return a.opListReadCapability||(l=Object.create(null),l.operatorListChanged=s,a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||=new Set).add(l),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(o)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(r){return r.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(i=>tl.textContent(i));let t=this.streamTextContent(e);return new Promise(function(i,r){function s(){o.read().then(function({value:l,done:c}){if(c){i(a);return}a.lang??=l.lang,Object.assign(a.styles,l.styles),a.items.push(...l.items),s()},r)}let o=t.getReader(),a={items:[],styles:Object.create(null),lang:null};s()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let e=[];for(let t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:new Error("Page was destroyed."),force:!0}),!t.opListReadCapability)for(let i of t.renderTasks)e.push(i.completed),i.cancel();return this.objs.clear(),this.#t=!1,this.#i(),Promise.all(e)}cleanup(e=!1){this.#t=!0;let t=this.#n(!1);return e&&t&&(this._stats&&=new kd),t}#n(e=!1){if(this.#i(),!this.#t||this.destroyed)return!1;if(e)return this.#e=setTimeout(()=>{this.#e=null,this.#n(!1)},nF),!1;for(let{renderTasks:t,operatorList:i}of this._intentStates.values())if(t.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#t=!1,!0}#i(){this.#e&&(clearTimeout(this.#e),this.#e=null)}_startRenderPage(e,t){let i=this._intentStates.get(t);i&&(this._stats?.timeEnd("Page Request"),i.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let i=0,r=e.length;i{l.read().then(({value:d,done:h})=>{if(h){c.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,c),u())},d=>{if(c.streamReader=null,!this._transport.destroyed){if(c.operatorList){c.operatorList.lastChunk=!0;for(let h of c.renderTasks)h.operatorListChanged();this.#n(!0)}if(c.displayReadyCapability)c.displayReadyCapability.reject(d);else if(c.opListReadCapability)c.opListReadCapability.reject(d);else throw d}})};u()}_abortOperatorList({intentState:e,reason:t,force:i=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!i){if(e.renderTasks.size>0)return;if(t instanceof Xa){let r=tF;t.extraDelay>0&&t.extraDelay<1e3&&(r+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},r);return}}if(e.streamReader.cancel(new _i(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(let[r,s]of this._intentStates)if(s===e){this._intentStates.delete(r);break}this.cleanup()}}}get stats(){return this._stats}},zv=class{#e=new Map;#t=Promise.resolve();postMessage(e,t){let i={data:structuredClone(e,t?{transfer:t}:null)};this.#t.then(()=>{for(let[r]of this.#e)r.call(this,i)})}addEventListener(e,t,i=null){let r=null;if(i?.signal instanceof AbortSignal){let{signal:s}=i;if(s.aborted){ie("LoopbackPort - cannot use an `aborted` signal.");return}let o=()=>this.removeEventListener(e,t);r=()=>s.removeEventListener("abort",o),s.addEventListener("abort",o)}this.#e.set(t,r)}removeEventListener(e,t){this.#e.get(t)?.(),this.#e.delete(t)}terminate(){for(let[,e]of this.#e)e?.();this.#e.clear()}},no=class n{static#e=0;static#t=!1;static#n;static{Et&&(this.#t=!0,Or.workerSrc||="./pdf.worker.mjs"),this._isSameOrigin=(e,t)=>{let i;try{if(i=new URL(e),!i.origin||i.origin==="null")return!1}catch{return!1}let r=new URL(t,i);return i.origin===r.origin},this._createCDNWrapper=e=>{let t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:"text/javascript"}))}}constructor({name:e=null,port:t=null,verbosity:i=CL()}={}){if(this.name=e,this.destroyed=!1,this.verbosity=i,this._readyCapability=Promise.withResolvers(),this._port=null,this._webWorker=null,this._messageHandler=null,t){if(n.#n?.has(t))throw new Error("Cannot use more than one PDFWorker per port.");(n.#n||=new WeakMap).set(t,this),this._initializeFromPort(t);return}this._initialize()}get promise(){return Et?Promise.all([Hn.promise,this._readyCapability.promise]):this._readyCapability.promise}#i(){this._readyCapability.resolve(),this._messageHandler.send("configure",{verbosity:this.verbosity})}get port(){return this._port}get messageHandler(){return this._messageHandler}_initializeFromPort(e){this._port=e,this._messageHandler=new kr("main","worker",e),this._messageHandler.on("ready",function(){}),this.#i()}_initialize(){if(n.#t||n.#r){this._setupFakeWorker();return}let{workerSrc:e}=n;try{n._isSameOrigin(window.location.href,e)||(e=n._createCDNWrapper(new URL(e,window.location).href));let t=new Worker(e,{type:"module"}),i=new kr("main","worker",t),r=()=>{s.abort(),i.destroy(),t.terminate(),this.destroyed?this._readyCapability.reject(new Error("Worker was destroyed")):this._setupFakeWorker()},s=new AbortController;t.addEventListener("error",()=>{this._webWorker||r()},{signal:s.signal}),i.on("test",a=>{if(s.abort(),this.destroyed||!a){r();return}this._messageHandler=i,this._port=t,this._webWorker=t,this.#i()}),i.on("ready",a=>{if(s.abort(),this.destroyed){r();return}try{o()}catch{this._setupFakeWorker()}});let o=()=>{let a=new Uint8Array;i.send("test",a,[a.buffer])};o();return}catch{fh("The worker has been disabled.")}this._setupFakeWorker()}_setupFakeWorker(){n.#t||(ie("Setting up fake worker."),n.#t=!0),n._setupFakeWorkerGlobal.then(e=>{if(this.destroyed){this._readyCapability.reject(new Error("Worker was destroyed"));return}let t=new zv;this._port=t;let i=`fake${n.#e++}`,r=new kr(i+"_worker",i,t);e.setup(r,t),this._messageHandler=new kr(i,i+"_worker",t),this.#i()}).catch(e=>{this._readyCapability.reject(new Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this._webWorker&&(this._webWorker.terminate(),this._webWorker=null),n.#n?.delete(this._port),this._port=null,this._messageHandler&&(this._messageHandler.destroy(),this._messageHandler=null)}static fromPort(e){if(!e?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");let t=this.#n?.get(e.port);if(t){if(t._pendingDestroy)throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return t}return new n(e)}static get workerSrc(){if(Or.workerSrc)return Or.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get#r(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return de(this,"_setupFakeWorkerGlobal",A(this,null,function*(){return this.#r?this.#r:(yield import(this.workerSrc)).WorkerMessageHandler}))}},Wv=class{#e=new Map;#t=new Map;#n=new Map;#i=new Map;#r=null;constructor(e,t,i,r,s){this.messageHandler=e,this.loadingTask=t,this.commonObjs=new Kd,this.fontLoader=new dv({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this.loadingParams=r.loadingParams,this._params=r,this.canvasFactory=s.canvasFactory,this.filterFactory=s.filterFactory,this.cMapReaderFactory=s.cMapReaderFactory,this.standardFontDataFactory=s.standardFontDataFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=i,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.setupMessageHandler()}#s(e,t=null){let i=this.#e.get(e);if(i)return i;let r=this.messageHandler.sendWithPromise(e,t);return this.#e.set(e,r),r}get annotationStorage(){return de(this,"annotationStorage",new Qa)}getRenderingIntent(e,t=Wi.ENABLE,i=null,r=!1,s=!1){let o=Qt.DISPLAY,a=uv;switch(e){case"any":o=Qt.ANY;break;case"display":break;case"print":o=Qt.PRINT;break;default:ie(`getRenderingIntent - invalid intent: ${e}`)}let l=o&Qt.PRINT&&i instanceof Vd?i:this.annotationStorage;switch(t){case Wi.DISABLE:o+=Qt.ANNOTATIONS_DISABLE;break;case Wi.ENABLE:break;case Wi.ENABLE_FORMS:o+=Qt.ANNOTATIONS_FORMS;break;case Wi.ENABLE_STORAGE:o+=Qt.ANNOTATIONS_STORAGE,a=l.serializable;break;default:ie(`getRenderingIntent - invalid annotationMode: ${t}`)}r&&(o+=Qt.IS_EDITING),s&&(o+=Qt.OPLIST);let{ids:c,hash:u}=l.modifiedIds,d=[o,a.hash,u];return{renderingIntent:o,cacheKey:d.join("_"),annotationStorageSerializable:a,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#r?.reject(new Error("Worker was destroyed during onPassword callback"));let e=[];for(let i of this.#t.values())e.push(i._destroy());this.#t.clear(),this.#n.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();let t=this.messageHandler.sendWithPromise("Terminate",null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),el.cleanup(),this._networkStream?.cancelAllRequests(new _i("Worker was terminated.")),this.messageHandler&&(this.messageHandler.destroy(),this.messageHandler=null),this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:e,loadingTask:t}=this;e.on("GetReader",(i,r)=>{it(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=s=>{this._lastProgress={loaded:s.loaded,total:s.total}},r.onPull=()=>{this._fullReader.read().then(function({value:s,done:o}){if(o){r.close();return}it(s instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{r.error(s)})},r.onCancel=s=>{this._fullReader.cancel(s),r.ready.catch(o=>{if(!this.destroyed)throw o})}}),e.on("ReaderHeadersReady",i=>A(this,null,function*(){yield this._fullReader.headersReady;let{isStreamingSupported:r,isRangeSupported:s,contentLength:o}=this._fullReader;return(!r||!s)&&(this._lastProgress&&t.onProgress?.(this._lastProgress),this._fullReader.onProgress=a=>{t.onProgress?.({loaded:a.loaded,total:a.total})}),{isStreamingSupported:r,isRangeSupported:s,contentLength:o}})),e.on("GetRangeReader",(i,r)=>{it(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");let s=this._networkStream.getRangeReader(i.begin,i.end);if(!s){r.close();return}r.onPull=()=>{s.read().then(function({value:o,done:a}){if(a){r.close();return}it(o instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),r.enqueue(new Uint8Array(o),1,[o])}).catch(o=>{r.error(o)})},r.onCancel=o=>{s.cancel(o),r.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("GetDoc",({pdfInfo:i})=>{this._numPages=i.numPages,this._htmlForXfa=i.htmlForXfa,delete i.htmlForXfa,t._capability.resolve(new Hv(i,this))}),e.on("DocException",function(i){let r;switch(i.name){case"PasswordException":r=new Ga(i.message,i.code);break;case"InvalidPDFException":r=new Nd(i.message);break;case"MissingPDFException":r=new wi(i.message);break;case"UnexpectedResponseException":r=new io(i.message,i.status);break;case"UnknownErrorException":r=new qa(i.message,i.details);break;default:Pe("DocException - expected a valid Error.")}t._capability.reject(r)}),e.on("PasswordRequest",i=>{if(this.#r=Promise.withResolvers(),t.onPassword){let r=s=>{s instanceof Error?this.#r.reject(s):this.#r.resolve({password:s})};try{t.onPassword(r,i.code)}catch(s){this.#r.reject(s)}}else this.#r.reject(new Ga(i.message,i.code));return this.#r.promise}),e.on("DataLoaded",i=>{t.onProgress?.({loaded:i.length,total:i.length}),this.downloadInfoCapability.resolve(i)}),e.on("StartRenderPage",i=>{if(this.destroyed)return;this.#t.get(i.pageIndex)._startRenderPage(i.transparency,i.cacheKey)}),e.on("commonobj",([i,r,s])=>{if(this.destroyed||this.commonObjs.has(i))return null;switch(r){case"Font":let{disableFontFace:o,fontExtraProperties:a,pdfBug:l}=this._params;if("error"in s){let h=s.error;ie(`Error during font loading: ${h}`),this.commonObjs.resolve(i,h);break}let c=l&&globalThis.FontInspector?.enabled?(h,f)=>globalThis.FontInspector.fontAdded(h,f):null,u=new hv(s,{disableFontFace:o,inspectFont:c});this.fontLoader.bind(u).catch(()=>e.sendWithPromise("FontFallback",{id:i})).finally(()=>{!a&&u.data&&(u.data=null),this.commonObjs.resolve(i,u)});break;case"CopyLocalImage":let{imageRef:d}=s;it(d,"The imageRef must be defined.");for(let h of this.#t.values())for(let[,f]of h.objs)if(f?.ref===d)return f.dataLen?(this.commonObjs.resolve(i,structuredClone(f)),f.dataLen):null;break;case"FontPath":case"Image":case"Pattern":this.commonObjs.resolve(i,s);break;default:throw new Error(`Got unknown common object type ${r}`)}return null}),e.on("obj",([i,r,s,o])=>{if(this.destroyed)return;let a=this.#t.get(r);if(!a.objs.has(i)){if(a._intentStates.size===0){o?.bitmap?.close();return}switch(s){case"Image":a.objs.resolve(i,o),o?.dataLen>vL&&(a._maybeCleanupAfterRender=!0);break;case"Pattern":a.objs.resolve(i,o);break;default:throw new Error(`Got unknown object type ${s}`)}}}),e.on("DocProgress",i=>{this.destroyed||t.onProgress?.({loaded:i.loaded,total:i.total})}),e.on("FetchBuiltInCMap",i=>A(this,null,function*(){if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.cMapReaderFactory)throw new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.");return this.cMapReaderFactory.fetch(i)})),e.on("FetchStandardFontData",i=>A(this,null,function*(){if(this.destroyed)throw new Error("Worker was destroyed.");if(!this.standardFontDataFactory)throw new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.");return this.standardFontDataFactory.fetch(i)}))}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&ie("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));let t=e-1,i=this.#n.get(t);if(i)return i;let r=this.messageHandler.sendWithPromise("GetPage",{pageIndex:t}).then(s=>{if(this.destroyed)throw new Error("Transport destroyed");s.refStr&&this.#i.set(s.refStr,e);let o=new $v(t,s,this,this._params.pdfBug);return this.#t.set(t,o),o});return this.#n.set(t,r),r}getPageIndex(e){return DD(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,t){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:t})}getFieldObjects(){return this.#s("GetFieldObjects")}hasJSActions(){return this.#s("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getDocJSActions(){return this.#s("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#s("GetOptionalContentConfig").then(t=>new Sv(t,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){let e="GetMetadata",t=this.#e.get(e);if(t)return t;let i=this.messageHandler.sendWithPromise(e,null).then(r=>({info:r[0],metadata:r[1]?new Av(r[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(e,i),i}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}startCleanup(e=!1){return A(this,null,function*(){if(!this.destroyed){yield this.messageHandler.sendWithPromise("Cleanup",null);for(let t of this.#t.values())if(!t.cleanup())throw new Error(`startCleanup: Page ${t.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),el.cleanup()}})}cachedPageNumber(e){if(!DD(e))return null;let t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this.#i.get(t)??null}},xd=Symbol("INITIAL_DATA"),Kd=class{#e=Object.create(null);#t(e){return this.#e[e]||=G(x({},Promise.withResolvers()),{data:xd})}get(e,t=null){if(t){let r=this.#t(e);return r.promise.then(()=>t(r.data)),null}let i=this.#e[e];if(!i||i.data===xd)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return i.data}has(e){let t=this.#e[e];return!!t&&t.data!==xd}resolve(e,t=null){let i=this.#t(e);i.data=t,i.resolve()}clear(){for(let e in this.#e){let{data:t}=this.#e[e];t?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(let e in this.#e){let{data:t}=this.#e[e];t!==xd&&(yield[e,t])}}},Gv=class{#e=null;constructor(e){this.#e=e,this.onContinue=null}get promise(){return this.#e.capability.promise}cancel(e=0){this.#e.cancel(null,e)}get separateAnnots(){let{separateAnnots:e}=this.#e.operatorList;if(!e)return!1;let{annotationCanvasMap:t}=this.#e;return e.form||e.canvas&&t?.size>0}},qv=class n{#e=null;static#t=new WeakSet;constructor({callback:e,params:t,objs:i,commonObjs:r,annotationCanvasMap:s,operatorList:o,pageIndex:a,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:u=!1,pdfBug:d=!1,pageColors:h=null}){this.callback=e,this.params=t,this.objs=i,this.commonObjs=r,this.annotationCanvasMap=s,this.operatorListIdx=null,this.operatorList=o,this._pageIndex=a,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=d,this.pageColors=h,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=u===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new Gv(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvasContext.canvas}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:t}){if(this.cancelled)return;if(this._canvas){if(n.#t.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");n.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{canvasContext:i,viewport:r,transform:s,background:o}=this.params;this.gfx=new to(i,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:t},this.annotationCanvasMap,this.pageColors),this.gfx.beginDrawing({transform:s,viewport:r,transparency:e,background:o}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,t=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),n.#t.delete(this._canvas),this.callback(e||new Xa(`Rendering cancelled, page ${this._pageIndex+1}`,t))}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}_next(){return A(this,null,function*(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),n.#t.delete(this._canvas),this.callback())))})}},uF="4.8.69",dF="3634dab10";function SD(n){return Math.floor(Math.max(0,Math.min(1,n))*255).toString(16).padStart(2,"0")}function $a(n){return Math.max(0,Math.min(255,255*n))}var Zd=class{static CMYK_G([e,t,i,r]){return["G",1-Math.min(1,.3*e+.59*i+.11*t+r)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=$a(e),[e,e,e]}static G_HTML([e]){let t=SD(e);return`#${t}${t}${t}`}static RGB_G([e,t,i]){return["G",.3*e+.59*t+.11*i]}static RGB_rgb(e){return e.map($a)}static RGB_HTML(e){return`#${e.map(SD).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,t,i,r]){return["RGB",1-Math.min(1,e+r),1-Math.min(1,i+r),1-Math.min(1,t+r)]}static CMYK_rgb([e,t,i,r]){return[$a(1-Math.min(1,e+r)),$a(1-Math.min(1,i+r)),$a(1-Math.min(1,t+r))]}static CMYK_HTML(e){let t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,i]){let r=1-e,s=1-t,o=1-i,a=Math.min(r,s,o);return["CMYK",r,s,o,a]}},Yv=class{create(e,t,i=!1){if(e<=0||t<=0)throw new Error("Invalid SVG dimensions");let r=this._createSVG("svg:svg");return r.setAttribute("version","1.1"),i||(r.setAttribute("width",`${e}px`),r.setAttribute("height",`${t}px`)),r.setAttribute("preserveAspectRatio","none"),r.setAttribute("viewBox",`0 0 ${e} ${t}`),r}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){Pe("Abstract method `_createSVG` called.")}},nl=class extends Yv{_createSVG(e){return document.createElementNS(yi,e)}},Qd=class{static setupStorage(e,t,i,r,s){let o=r.getValue(t,{value:null});switch(i.name){case"textarea":if(o.value!==null&&(e.textContent=o.value),s==="print")break;e.addEventListener("input",a=>{r.setValue(t,{value:a.target.value})});break;case"input":if(i.attributes.type==="radio"||i.attributes.type==="checkbox"){if(o.value===i.attributes.xfaOn?e.setAttribute("checked",!0):o.value===i.attributes.xfaOff&&e.removeAttribute("checked"),s==="print")break;e.addEventListener("change",a=>{r.setValue(t,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(o.value!==null&&e.setAttribute("value",o.value),s==="print")break;e.addEventListener("input",a=>{r.setValue(t,{value:a.target.value})})}break;case"select":if(o.value!==null){e.setAttribute("value",o.value);for(let a of i.children)a.attributes.value===o.value?a.attributes.selected=!0:a.attributes.hasOwnProperty("selected")&&delete a.attributes.selected}e.addEventListener("input",a=>{let l=a.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;r.setValue(t,{value:c})});break}}static setAttributes({html:e,element:t,storage:i=null,intent:r,linkService:s}){let{attributes:o}=t,a=e instanceof HTMLAnchorElement;o.type==="radio"&&(o.name=`${o.name}-${r}`);for(let[l,c]of Object.entries(o))if(c!=null)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!a||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,c)}a&&s.addLinkAttributes(e,o.href,o.newWindow),i&&o.dataId&&this.setupStorage(e,o.dataId,t,i)}static render(e){let t=e.annotationStorage,i=e.linkService,r=e.xfaHtml,s=e.intent||"display",o=document.createElement(r.name);r.attributes&&this.setAttributes({html:o,element:r,intent:s,linkService:i});let a=s!=="richText",l=e.div;if(l.append(o),e.viewport){let d=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=d}a&&l.setAttribute("class","xfaLayer xfaFont");let c=[];if(r.children.length===0){if(r.value){let d=document.createTextNode(r.value);o.append(d),a&&tl.shouldBuildText(r.name)&&c.push(d)}return{textDivs:c}}let u=[[r,-1,o]];for(;u.length>0;){let[d,h,f]=u.at(-1);if(h+1===d.children.length){u.pop();continue}let p=d.children[++u.at(-1)[1]];if(p===null)continue;let{name:g}=p;if(g==="#text"){let m=document.createTextNode(p.value);c.push(m),f.append(m);continue}let v=p?.attributes?.xmlns?document.createElementNS(p.attributes.xmlns,g):document.createElement(g);if(f.append(v),p.attributes&&this.setAttributes({html:v,element:p,storage:t,intent:s,linkService:i}),p.children?.length>0)u.push([p,-1,v]);else if(p.value){let m=document.createTextNode(p.value);a&&tl.shouldBuildText(g)&&c.push(m),v.append(m)}}for(let d of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))d.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){let t=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=t,e.div.hidden=!1}},ol=1e3,hF=9,Vr=new WeakSet;function bi(n){return{width:n[2]-n[0],height:n[3]-n[1]}}var Xv=class{static create(e){switch(e.data.annotationType){case nt.LINK:return new Jd(e);case nt.TEXT:return new Kv(e);case nt.WIDGET:switch(e.data.fieldType){case"Tx":return new Zv(e);case"Btn":return e.data.radioButton?new eh(e):e.data.checkBox?new Jv(e):new ey(e);case"Ch":return new ty(e);case"Sig":return new Qv(e)}return new Ei(e);case nt.POPUP:return new il(e);case nt.FREETEXT:return new th(e);case nt.LINE:return new iy(e);case nt.SQUARE:return new ry(e);case nt.CIRCLE:return new sy(e);case nt.POLYLINE:return new nh(e);case nt.CARET:return new ay(e);case nt.INK:return new rl(e);case nt.POLYGON:return new oy(e);case nt.HIGHLIGHT:return new ih(e);case nt.UNDERLINE:return new ly(e);case nt.SQUIGGLY:return new cy(e);case nt.STRIKEOUT:return new uy(e);case nt.STAMP:return new rh(e);case nt.FILEATTACHMENT:return new dy(e);default:return new qe(e)}}},qe=class n{#e=null;#t=!1;#n=null;constructor(e,{isRenderable:t=!1,ignoreBorder:i=!1,createQuadrilaterals:r=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,t&&(this.container=this._createContainer(i)),r&&this._createQuadrilaterals()}static _hasPopupData({titleObj:e,contentsObj:t,richText:i}){return!!(e?.str||t?.str||i?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return n._hasPopupData(this.data)}updateEdited(e){if(!this.container)return;this.#e||={rect:this.data.rect.slice(0)};let{rect:t}=e;t&&this.#i(t),this.#n?.popup.updateEdited(e)}resetEdited(){this.#e&&(this.#i(this.#e.rect),this.#n?.popup.resetEdited(),this.#e=null)}#i(e){let{container:{style:t},data:{rect:i,rotation:r},parent:{viewport:{rawDims:{pageWidth:s,pageHeight:o,pageX:a,pageY:l}}}}=this;i?.splice(0,4,...e);let{width:c,height:u}=bi(e);t.left=`${100*(e[0]-a)/s}%`,t.top=`${100*(o-e[3]+l)/o}%`,r===0?(t.width=`${100*c/s}%`,t.height=`${100*u/o}%`):this.setRotation(r)}_createContainer(e){let{data:t,parent:{page:i,viewport:r}}=this,s=document.createElement("section");s.setAttribute("data-annotation-id",t.id),this instanceof Ei||(s.tabIndex=ol);let{style:o}=s;if(o.zIndex=this.parent.zIndex++,t.alternativeText&&(s.title=t.alternativeText),t.noRotate&&s.classList.add("norotate"),!t.rect||this instanceof il){let{rotation:g}=t;return!t.hasOwnCanvas&&g!==0&&this.setRotation(g,s),s}let{width:a,height:l}=bi(t.rect);if(!e&&t.borderStyle.width>0){o.borderWidth=`${t.borderStyle.width}px`;let g=t.borderStyle.horizontalCornerRadius,v=t.borderStyle.verticalCornerRadius;if(g>0||v>0){let y=`calc(${g}px * var(--scale-factor)) / calc(${v}px * var(--scale-factor))`;o.borderRadius=y}else if(this instanceof eh){let y=`calc(${a}px * var(--scale-factor)) / calc(${l}px * var(--scale-factor))`;o.borderRadius=y}switch(t.borderStyle.style){case Ua.SOLID:o.borderStyle="solid";break;case Ua.DASHED:o.borderStyle="dashed";break;case Ua.BEVELED:ie("Unimplemented border style: beveled");break;case Ua.INSET:ie("Unimplemented border style: inset");break;case Ua.UNDERLINE:o.borderBottomStyle="solid";break;default:break}let m=t.borderColor||null;m?(this.#t=!0,o.borderColor=B.makeHexColor(m[0]|0,m[1]|0,m[2]|0)):o.borderWidth=0}let c=B.normalizeRect([t.rect[0],i.view[3]-t.rect[1]+i.view[1],t.rect[2],i.view[3]-t.rect[3]+i.view[1]]),{pageWidth:u,pageHeight:d,pageX:h,pageY:f}=r.rawDims;o.left=`${100*(c[0]-h)/u}%`,o.top=`${100*(c[1]-f)/d}%`;let{rotation:p}=t;return t.hasOwnCanvas||p===0?(o.width=`${100*a/u}%`,o.height=`${100*l/d}%`):this.setRotation(p,s),s}setRotation(e,t=this.container){if(!this.data.rect)return;let{pageWidth:i,pageHeight:r}=this.parent.viewport.rawDims,{width:s,height:o}=bi(this.data.rect),a,l;e%180===0?(a=100*s/i,l=100*o/r):(a=100*o/i,l=100*s/r),t.style.width=`${a}%`,t.style.height=`${l}%`,t.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){let e=(t,i,r)=>{let s=r.detail[t],o=s[0],a=s.slice(1);r.target.style[i]=Zd[`${o}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[i]:Zd[`${o}_rgb`](a)})};return de(this,"_commonActions",{display:t=>{let{display:i}=t.detail,r=i%2===1;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:r,noPrint:i===1||i===2})},print:t=>{this.annotationStorage.setValue(this.data.id,{noPrint:!t.detail.print})},hidden:t=>{let{hidden:i}=t.detail;this.container.style.visibility=i?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:i,noView:i})},focus:t=>{setTimeout(()=>t.target.focus({preventScroll:!1}),0)},userName:t=>{t.target.title=t.detail.userName},readonly:t=>{t.target.disabled=t.detail.readonly},required:t=>{this._setRequired(t.target,t.detail.required)},bgColor:t=>{e("bgColor","backgroundColor",t)},fillColor:t=>{e("fillColor","backgroundColor",t)},fgColor:t=>{e("fgColor","color",t)},textColor:t=>{e("textColor","color",t)},borderColor:t=>{e("borderColor","borderColor",t)},strokeColor:t=>{e("strokeColor","borderColor",t)},rotation:t=>{let i=t.detail.rotation;this.setRotation(i),this.annotationStorage.setValue(this.data.id,{rotation:i})}})}_dispatchEventFromSandbox(e,t){let i=this._commonActions;for(let r of Object.keys(t.detail))(e[r]||i[r])?.(t)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;let t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;let i=this._commonActions;for(let[r,s]of Object.entries(t)){let o=i[r];if(o){let a={detail:{[r]:s},target:e};o(a),delete t[r]}}}_createQuadrilaterals(){if(!this.container)return;let{quadPoints:e}=this.data;if(!e)return;let[t,i,r,s]=this.data.rect.map(g=>Math.fround(g));if(e.length===8){let[g,v,m,y]=e.subarray(2,6);if(r===g&&s===v&&t===m&&i===y)return}let{style:o}=this.container,a;if(this.#t){let{borderColor:g,borderWidth:v}=o;o.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'',``],this.container.classList.add("hasBorder")}let l=r-t,c=s-i,{svgFactory:u}=this,d=u.createElement("svg");d.classList.add("quadrilateralsContainer"),d.setAttribute("width",0),d.setAttribute("height",0);let h=u.createElement("defs");d.append(h);let f=u.createElement("clipPath"),p=`clippath_${this.data.id}`;f.setAttribute("id",p),f.setAttribute("clipPathUnits","objectBoundingBox"),h.append(f);for(let g=2,v=e.length;g`)}this.#t&&(a.push("')"),o.backgroundImage=a.join("")),this.container.append(d),this.container.style.clipPath=`url(#${p})`}_createPopup(){let{data:e}=this,t=this.#n=new il({data:{color:e.color,titleObj:e.titleObj,modificationDate:e.modificationDate,contentsObj:e.contentsObj,richText:e.richText,parentRect:e.rect,borderStyle:0,id:`popup_${e.id}`,rotation:e.rotation},parent:this.parent,elements:[this]});this.parent.div.append(t.render())}render(){Pe("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){let i=[];if(this._fieldObjects){let r=this._fieldObjects[e];if(r)for(let{page:s,id:o,exportValues:a}of r){if(s===-1||o===t)continue;let l=typeof a=="string"?a:null,c=document.querySelector(`[data-element-id="${o}"]`);if(c&&!Vr.has(c)){ie(`_getElementsByName - element not allowed: ${o}`);continue}i.push({id:o,exportValue:l,domElement:c})}return i}for(let r of document.getElementsByName(e)){let{exportValue:s}=r,o=r.getAttribute("data-element-id");o!==t&&Vr.has(r)&&i.push({id:o,exportValue:s,domElement:r})}return i}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){let e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(let t of e)t.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:t})})}},Jd=class extends qe{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){let{data:e,linkService:t}=this,i=document.createElement("a");i.setAttribute("data-element-id",e.id);let r=!1;return e.url?(t.addLinkAttributes(i,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(i,e.action),r=!0):e.attachment?(this.#t(i,e.attachment,e.attachmentDest),r=!0):e.setOCGState?(this.#n(i,e.setOCGState),r=!0):e.dest?(this._bindLink(i,e.dest),r=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(i,e),r=!0),e.resetForm?(this._bindResetFormAction(i,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(i,""),r=!0)),this.container.classList.add("linkAnnotation"),r&&this.container.append(i),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(e,t){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||t==="")&&this.#e()}_bindNamedAction(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),this.#e()}#t(e,t,i=null){e.href=this.linkService.getAnchorUrl(""),t.description&&(e.title=t.description),e.onclick=()=>(this.downloadManager?.openOrDownloadData(t.content,t.filename,i),!1),this.#e()}#n(e,t){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),this.#e()}_bindJSAction(e,t){e.href=this.linkService.getAnchorUrl("");let i=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(let r of Object.keys(t.actions)){let s=i.get(r);s&&(e[s]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t.id,name:r}}),!1))}e.onclick||(e.onclick=()=>!1),this.#e()}_bindResetFormAction(e,t){let i=e.onclick;if(i||(e.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){ie('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),i||(e.onclick=()=>!1);return}e.onclick=()=>{i?.();let{fields:r,refs:s,include:o}=t,a=[];if(r.length!==0||s.length!==0){let u=new Set(s);for(let d of r){let h=this._fieldObjects[d]||[];for(let{id:f}of h)u.add(f)}for(let d of Object.values(this._fieldObjects))for(let h of d)u.has(h.id)===o&&a.push(h)}else for(let u of Object.values(this._fieldObjects))a.push(...u);let l=this.annotationStorage,c=[];for(let u of a){let{id:d}=u;switch(c.push(d),u.type){case"text":{let f=u.defaultValue||"";l.setValue(d,{value:f});break}case"checkbox":case"radiobutton":{let f=u.defaultValue===u.exportValues;l.setValue(d,{value:f});break}case"combobox":case"listbox":{let f=u.defaultValue||"";l.setValue(d,{value:f});break}default:continue}let h=document.querySelector(`[data-element-id="${d}"]`);if(h){if(!Vr.has(h)){ie(`_bindResetFormAction - element not allowed: ${d}`);continue}}else continue;h.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:c,name:"ResetForm"}}),!1}}},Kv=class extends qe{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");let e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&this._createPopup(),this.container.append(e),this.container}},Ei=class extends qe{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return pt.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,i,r,s){i.includes("mouse")?e.addEventListener(i,o=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:s(o),shift:o.shiftKey,modifier:this._getKeyModifier(o)}})}):e.addEventListener(i,o=>{if(i==="blur"){if(!t.focused||!o.relatedTarget)return;t.focused=!1}else if(i==="focus"){if(t.focused)return;t.focused=!0}s&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:r,value:s(o)}})})}_setEventListeners(e,t,i,r){for(let[s,o]of i)(o==="Action"||this.data.actions?.[o])&&((o==="Focus"||o==="Blur")&&(t||={focused:!1}),this._setEventListener(e,t,s,o,r),o==="Focus"&&!this.data.actions?.Blur?this._setEventListener(e,t,"blur","Blur",null):o==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(e,t,"focus","Focus",null))}_setBackgroundColor(e){let t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?"transparent":B.makeHexColor(t[0],t[1],t[2])}_setTextStyle(e){let t=["left","center","right"],{fontColor:i}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||hF,s=e.style,o,a=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){let c=Math.abs(this.data.rect[3]-this.data.rect[1]-a),u=Math.round(c/(Td*r))||1,d=c/u;o=Math.min(r,l(d/Td))}else{let c=Math.abs(this.data.rect[3]-this.data.rect[1]-a);o=Math.min(r,l(c/Td))}s.fontSize=`calc(${o}px * var(--scale-factor))`,s.color=B.makeHexColor(i[0],i[1],i[2]),this.data.textAlignment!==null&&(s.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",t)}},Zv=class extends Ei{constructor(e){let t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,i,r){let s=this.annotationStorage;for(let o of this._getElementsByName(e.name,e.id))o.domElement&&(o.domElement[t]=i),s.setValue(o.id,{[r]:i})}render(){let e=this.annotationStorage,t=this.data.id;this.container.classList.add("textWidgetAnnotation");let i=null;if(this.renderForms){let r=e.getValue(t,{value:this.data.fieldValue}),s=r.value||"",o=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;o&&s.length>o&&(s=s.slice(0,o));let a=r.formattedValue||this.data.textContent?.join(` `)||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));let l={userValue:s,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(i=document.createElement("textarea"),i.textContent=a??s,this.data.doNotScroll&&(i.style.overflowY="hidden")):(i=document.createElement("input"),i.type="text",i.setAttribute("value",a??s),this.data.doNotScroll&&(i.style.overflowX="hidden")),this.data.hasOwnCanvas&&(i.hidden=!0),Vr.add(i),i.setAttribute("data-element-id",t),i.disabled=this.data.readOnly,i.name=this.data.fieldName,i.tabIndex=ol,this._setRequired(i,this.data.required),o&&(i.maxLength=o),i.addEventListener("input",u=>{e.setValue(t,{value:u.target.value}),this.setPropertyOnSiblings(i,"value",u.target.value,"value"),l.formattedValue=null}),i.addEventListener("resetform",u=>{let d=this.data.defaultFieldValue??"";i.value=l.userValue=d,l.formattedValue=null});let c=u=>{let{formattedValue:d}=l;d!=null&&(u.target.value=d),u.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){i.addEventListener("focus",d=>{if(l.focused)return;let{target:h}=d;l.userValue&&(h.value=l.userValue),l.lastCommittedValue=h.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),i.addEventListener("updatefromsandbox",d=>{this.showElementAndHideCanvas(d.target);let h={value(f){l.userValue=f.detail.value??"",e.setValue(t,{value:l.userValue.toString()}),f.target.value=l.userValue},formattedValue(f){let{formattedValue:p}=f.detail;l.formattedValue=p,p!=null&&f.target!==document.activeElement&&(f.target.value=p),e.setValue(t,{formattedValue:p})},selRange(f){f.target.setSelectionRange(...f.detail.selRange)},charLimit:f=>{let{charLimit:p}=f.detail,{target:g}=f;if(p===0){g.removeAttribute("maxLength");return}g.setAttribute("maxLength",p);let v=l.userValue;!v||v.length<=p||(v=v.slice(0,p),g.value=l.userValue=v,e.setValue(t,{value:v}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:v,willCommit:!0,commitKey:1,selStart:g.selectionStart,selEnd:g.selectionEnd}}))}};this._dispatchEventFromSandbox(h,d)}),i.addEventListener("keydown",d=>{l.commitKey=1;let h=-1;if(d.key==="Escape"?h=0:d.key==="Enter"&&!this.data.multiLine?h=2:d.key==="Tab"&&(l.commitKey=3),h===-1)return;let{value:f}=d.target;l.lastCommittedValue!==f&&(l.lastCommittedValue=f,l.userValue=f,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:f,willCommit:!0,commitKey:h,selStart:d.target.selectionStart,selEnd:d.target.selectionEnd}}))});let u=c;c=null,i.addEventListener("blur",d=>{if(!l.focused||!d.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);let{value:h}=d.target;l.userValue=h,l.lastCommittedValue!==h&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:h,willCommit:!0,commitKey:l.commitKey,selStart:d.target.selectionStart,selEnd:d.target.selectionEnd}}),u(d)}),this.data.actions?.Keystroke&&i.addEventListener("beforeinput",d=>{l.lastCommittedValue=null;let{data:h,target:f}=d,{value:p,selectionStart:g,selectionEnd:v}=f,m=g,y=v;switch(d.inputType){case"deleteWordBackward":{let b=p.substring(0,g).match(/\w*[^\w]*$/);b&&(m-=b[0].length);break}case"deleteWordForward":{let b=p.substring(g).match(/^[^\w]*\w*/);b&&(y+=b[0].length);break}case"deleteContentBackward":g===v&&(m-=1);break;case"deleteContentForward":g===v&&(y+=1);break}d.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:p,change:h||"",willCommit:!1,selStart:m,selEnd:y}})}),this._setEventListeners(i,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],d=>d.target.value)}if(c&&i.addEventListener("blur",c),this.data.comb){let d=(this.data.rect[2]-this.data.rect[0])/o;i.classList.add("comb"),i.style.letterSpacing=`calc(${d}px * var(--scale-factor) - 1ch)`}}else i=document.createElement("div"),i.textContent=this.data.fieldValue,i.style.verticalAlign="middle",i.style.display="table-cell",this.data.hasOwnCanvas&&(i.hidden=!0);return this._setTextStyle(i),this._setBackgroundColor(i),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},Qv=class extends Ei{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}},Jv=class extends Ei{constructor(e){super(e,{isRenderable:e.renderForms})}render(){let e=this.annotationStorage,t=this.data,i=t.id,r=e.getValue(i,{value:t.exportValue===t.fieldValue}).value;typeof r=="string"&&(r=r!=="Off",e.setValue(i,{value:r})),this.container.classList.add("buttonWidgetAnnotation","checkBox");let s=document.createElement("input");return Vr.add(s),s.setAttribute("data-element-id",i),s.disabled=t.readOnly,this._setRequired(s,this.data.required),s.type="checkbox",s.name=t.fieldName,r&&s.setAttribute("checked",!0),s.setAttribute("exportValue",t.exportValue),s.tabIndex=ol,s.addEventListener("change",o=>{let{name:a,checked:l}=o.target;for(let c of this._getElementsByName(a,i)){let u=l&&c.exportValue===t.exportValue;c.domElement&&(c.domElement.checked=u),e.setValue(c.id,{value:u})}e.setValue(i,{value:l})}),s.addEventListener("resetform",o=>{let a=t.defaultFieldValue||"Off";o.target.checked=a===t.exportValue}),this.enableScripting&&this.hasJSActions&&(s.addEventListener("updatefromsandbox",o=>{let a={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(i,{value:l.target.checked})}};this._dispatchEventFromSandbox(a,o)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],o=>o.target.checked)),this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}},eh=class extends Ei{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");let e=this.annotationStorage,t=this.data,i=t.id,r=e.getValue(i,{value:t.fieldValue===t.buttonValue}).value;if(typeof r=="string"&&(r=r!==t.buttonValue,e.setValue(i,{value:r})),r)for(let o of this._getElementsByName(t.fieldName,i))e.setValue(o.id,{value:!1});let s=document.createElement("input");if(Vr.add(s),s.setAttribute("data-element-id",i),s.disabled=t.readOnly,this._setRequired(s,this.data.required),s.type="radio",s.name=t.fieldName,r&&s.setAttribute("checked",!0),s.tabIndex=ol,s.addEventListener("change",o=>{let{name:a,checked:l}=o.target;for(let c of this._getElementsByName(a,i))e.setValue(c.id,{value:!1});e.setValue(i,{value:l})}),s.addEventListener("resetform",o=>{let a=t.defaultFieldValue;o.target.checked=a!=null&&a===t.buttonValue}),this.enableScripting&&this.hasJSActions){let o=t.buttonValue;s.addEventListener("updatefromsandbox",a=>{let l={value:c=>{let u=o===c.detail.value;for(let d of this._getElementsByName(c.target.name)){let h=u&&d.id===i;d.domElement&&(d.domElement.checked=h),e.setValue(d.id,{value:h})}}};this._dispatchEventFromSandbox(l,a)}),this._setEventListeners(s,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)}return this._setBackgroundColor(s),this._setDefaultPropertiesFromJS(s),this.container.append(s),this.container}},ey=class extends Jd{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){let e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");let t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener("updatefromsandbox",i=>{this._dispatchEventFromSandbox({},i)})),e}},ty=class extends Ei{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");let e=this.annotationStorage,t=this.data.id,i=e.getValue(t,{value:this.data.fieldValue}),r=document.createElement("select");Vr.add(r),r.setAttribute("data-element-id",t),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=ol;let s=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener("resetform",u=>{let d=this.data.defaultFieldValue;for(let h of r.options)h.selected=h.value===d});for(let u of this.data.options){let d=document.createElement("option");d.textContent=u.displayValue,d.value=u.exportValue,i.value.includes(u.exportValue)&&(d.setAttribute("selected",!0),s=!1),r.append(d)}let o=null;if(s){let u=document.createElement("option");u.value=" ",u.setAttribute("hidden",!0),u.setAttribute("selected",!0),r.prepend(u),o=()=>{u.remove(),r.removeEventListener("input",o),o=null},r.addEventListener("input",o)}let a=u=>{let d=u?"value":"textContent",{options:h,multiple:f}=r;return f?Array.prototype.filter.call(h,p=>p.selected).map(p=>p[d]):h.selectedIndex===-1?null:h[h.selectedIndex][d]},l=a(!1),c=u=>{let d=u.target.options;return Array.prototype.map.call(d,h=>({displayValue:h.textContent,exportValue:h.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener("updatefromsandbox",u=>{let d={value(h){o?.();let f=h.detail.value,p=new Set(Array.isArray(f)?f:[f]);for(let g of r.options)g.selected=p.has(g.value);e.setValue(t,{value:a(!0)}),l=a(!1)},multipleSelection(h){r.multiple=!0},remove(h){let f=r.options,p=h.detail.remove;f[p].selected=!1,r.remove(p),f.length>0&&Array.prototype.findIndex.call(f,v=>v.selected)===-1&&(f[0].selected=!0),e.setValue(t,{value:a(!0),items:c(h)}),l=a(!1)},clear(h){for(;r.length!==0;)r.remove(0);e.setValue(t,{value:null,items:[]}),l=a(!1)},insert(h){let{index:f,displayValue:p,exportValue:g}=h.detail.insert,v=r.children[f],m=document.createElement("option");m.textContent=p,m.value=g,v?v.before(m):r.append(m),e.setValue(t,{value:a(!0),items:c(h)}),l=a(!1)},items(h){let{items:f}=h.detail;for(;r.length!==0;)r.remove(0);for(let p of f){let{displayValue:g,exportValue:v}=p,m=document.createElement("option");m.textContent=g,m.value=v,r.append(m)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:a(!0),items:c(h)}),l=a(!1)},indices(h){let f=new Set(h.detail.indices);for(let p of h.target.options)p.selected=f.has(p.index);e.setValue(t,{value:a(!0)}),l=a(!1)},editable(h){h.target.disabled=!h.detail.editable}};this._dispatchEventFromSandbox(d,u)}),r.addEventListener("input",u=>{let d=a(!0),h=a(!1);e.setValue(t,{value:d}),u.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:t,name:"Keystroke",value:l,change:h,changeEx:d,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(r,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],u=>u.target.value)):r.addEventListener("input",function(u){e.setValue(t,{value:a(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}},il=class extends qe{constructor(e){let{data:t,elements:i}=e;super(e,{isRenderable:qe._hasPopupData(t)}),this.elements=i,this.popup=null}render(){this.container.classList.add("popupAnnotation");let e=this.popup=new ny({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open}),t=[];for(let i of this.elements)i.popup=e,i.container.ariaHasPopup="dialog",t.push(i.data.id),i.addHighlightArea();return this.container.setAttribute("aria-controls",t.map(i=>`${wy}${i}`).join(",")),this.container}},ny=class{#e=this.#M.bind(this);#t=this.#S.bind(this);#n=this.#I.bind(this);#i=this.#A.bind(this);#r=null;#s=null;#l=null;#c=null;#u=null;#a=null;#d=null;#o=!1;#h=null;#p=null;#f=null;#g=null;#v=null;#m=null;#y=!1;constructor({container:e,color:t,elements:i,titleObj:r,modificationDate:s,contentsObj:o,richText:a,parent:l,rect:c,parentRect:u,open:d}){this.#s=e,this.#v=r,this.#l=o,this.#g=a,this.#a=l,this.#r=t,this.#f=c,this.#d=u,this.#u=i,this.#c=Od.toDateObject(s),this.trigger=i.flatMap(h=>h.getElementsToTriggerPopup());for(let h of this.trigger)h.addEventListener("click",this.#i),h.addEventListener("mouseenter",this.#n),h.addEventListener("mouseleave",this.#t),h.classList.add("popupTriggerArea");for(let h of i)h.container?.addEventListener("keydown",this.#e);this.#s.hidden=!0,d&&this.#A()}render(){if(this.#h)return;let e=this.#h=document.createElement("div");if(e.className="popup",this.#r){let s=e.style.outlineColor=B.makeHexColor(...this.#r);CSS.supports("background-color","color-mix(in srgb, red 30%, white)")?e.style.backgroundColor=`color-mix(in srgb, ${s} 30%, white)`:e.style.backgroundColor=B.makeHexColor(...this.#r.map(a=>Math.floor(.7*(255-a)+a)))}let t=document.createElement("span");t.className="header";let i=document.createElement("h1");if(t.append(i),{dir:i.dir,str:i.textContent}=this.#v,e.append(t),this.#c){let s=document.createElement("span");s.classList.add("popupDate"),s.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),s.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#c.valueOf()})),t.append(s)}let r=this.#w;if(r)Qd.render({xfaHtml:r,intent:"richText",div:e}),e.lastChild.classList.add("richText","popupContent");else{let s=this._formatContents(this.#l);e.append(s)}this.#s.append(e)}get#w(){let e=this.#g,t=this.#l;return e?.str&&(!t?.str||t.str===e.str)&&this.#g.html||null}get#C(){return this.#w?.attributes?.style?.fontSize||0}get#_(){return this.#w?.attributes?.style?.color||null}#E(e){let t=[],i={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:t}]}},r={style:{color:this.#_,fontSize:this.#C?`calc(${this.#C}px * var(--scale-factor))`:""}};for(let s of e.split(` `))t.push({name:"span",value:s,attributes:r});return i}_formatContents({str:e,dir:t}){let i=document.createElement("p");i.classList.add("popupContent"),i.dir=t;let r=e.split(/(?:\r\n?|\n)/);for(let s=0,o=r.length;s{s.key==="Enter"&&(r?s.metaKey:s.ctrlKey)&&this.#t()}),!t.popupRef&&this.hasPopupData?this._createPopup():i.classList.add("popupTriggerArea"),e.append(i),e}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add("highlightArea")}#t(){this.downloadManager?.openOrDownloadData(this.content,this.filename)}},hy=class{#e=null;#t=null;#n=new Map;#i=null;constructor({div:e,accessibilityManager:t,annotationCanvasMap:i,annotationEditorUIManager:r,page:s,viewport:o,structTreeLayer:a}){this.div=e,this.#e=t,this.#t=i,this.#i=a||null,this.page=s,this.viewport=o,this.zIndex=0,this._annotationEditorUIManager=r}hasEditableAnnotations(){return this.#n.size>0}#r(e,t){return A(this,null,function*(){let i=e.firstChild||e,r=i.id=`${wy}${t}`,s=yield this.#i?.getAriaAttributes(r);if(s)for(let[o,a]of s)i.setAttribute(o,a);this.div.append(e),this.#e?.moveElementInDOM(this.div,e,i,!1)})}render(e){return A(this,null,function*(){let{annotations:t}=e,i=this.div;Lr(i,this.viewport);let r=new Map,s={data:null,layer:i,linkService:e.linkService,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||"",renderForms:e.renderForms!==!1,svgFactory:new nl,annotationStorage:e.annotationStorage||new Qa,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(let o of t){if(o.noHTML)continue;let a=o.annotationType===nt.POPUP;if(a){let u=r.get(o.id);if(!u)continue;s.elements=u}else{let{width:u,height:d}=bi(o.rect);if(u<=0||d<=0)continue}s.data=o;let l=Xv.create(s);if(!l.isRenderable)continue;if(!a&&o.popupRef){let u=r.get(o.popupRef);u?u.push(l):r.set(o.popupRef,[l])}let c=l.render();o.hidden&&(c.style.visibility="hidden"),yield this.#r(c,o.id),l._isEditable&&(this.#n.set(l.data.id,l),this._annotationEditorUIManager?.renderAnnotationElement(l))}this.#s()})}update({viewport:e}){let t=this.div;this.viewport=e,Lr(t,{rotation:e.rotation}),this.#s(),t.hidden=!1}#s(){if(!this.#t)return;let e=this.div;for(let[t,i]of this.#t){let r=e.querySelector(`[data-annotation-id="${t}"]`);if(!r)continue;i.className="annotationContent";let{firstChild:s}=r;s?s.nodeName==="CANVAS"?s.replaceWith(i):s.classList.contains("annotationContent")?s.after(i):s.before(i):r.append(i)}this.#t.clear()}getEditableAnnotations(){return Array.from(this.#n.values())}getEditableAnnotation(e){return this.#n.get(e)}},Id=/\r\n?|\n/g,fy=class n extends _e{#e;#t="";#n=`${this.id}-editor`;#i=null;#r;static _freeTextDefaultContent="";static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){let e=n.prototype,t=s=>s.isEmpty(),i=Za.TRANSLATE_SMALL,r=Za.TRANSLATE_BIG;return de(this,"_keyboardManager",new Fr([[["ctrl+s","mac+meta+s","ctrl+p","mac+meta+p"],e.commitOrRemove,{bubbles:!0}],[["ctrl+Enter","mac+meta+Enter","Escape","mac+Escape"],e.commitOrRemove],[["ArrowLeft","mac+ArrowLeft"],e._translateEmpty,{args:[-i,0],checker:t}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e._translateEmpty,{args:[-r,0],checker:t}],[["ArrowRight","mac+ArrowRight"],e._translateEmpty,{args:[i,0],checker:t}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e._translateEmpty,{args:[r,0],checker:t}],[["ArrowUp","mac+ArrowUp"],e._translateEmpty,{args:[0,-i],checker:t}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e._translateEmpty,{args:[0,-r],checker:t}],[["ArrowDown","mac+ArrowDown"],e._translateEmpty,{args:[0,i],checker:t}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e._translateEmpty,{args:[0,r],checker:t}]]))}static _type="freetext";static _editorType=te.FREETEXT;constructor(e){super(G(x({},e),{name:"freeTextEditor"})),this.#e=e.color||n._defaultColor||_e._defaultLineColor,this.#r=e.fontSize||n._defaultFontSize}static initialize(e,t){_e.initialize(e,t);let i=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(i.getPropertyValue("--freetext-padding"))}static updateDefaultParams(e,t){switch(e){case q.FREETEXT_SIZE:n._defaultFontSize=t;break;case q.FREETEXT_COLOR:n._defaultColor=t;break}}updateParams(e,t){switch(e){case q.FREETEXT_SIZE:this.#s(t);break;case q.FREETEXT_COLOR:this.#l(t);break}}static get defaultPropertiesToUpdate(){return[[q.FREETEXT_SIZE,n._defaultFontSize],[q.FREETEXT_COLOR,n._defaultColor||_e._defaultLineColor]]}get propertiesToUpdate(){return[[q.FREETEXT_SIZE,this.#r],[q.FREETEXT_COLOR,this.#e]]}#s(e){let t=r=>{this.editorDiv.style.fontSize=`calc(${r}px * var(--scale-factor))`,this.translate(0,-(r-this.#r)*this.parentScale),this.#r=r,this.#u()},i=this.#r;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:q.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}#l(e){let t=r=>{this.#e=this.editorDiv.style.color=r},i=this.#e;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:q.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){let e=this.parentScale;return[-n._internalPadding*e,-(n._internalPadding+this.#r)*e]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(this.isInEditMode())return;this.parent.setEditingState(!1),this.parent.updateToolbar(te.FREETEXT),super.enableEditMode(),this.overlayDiv.classList.remove("enabled"),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute("aria-activedescendant"),this.#i=new AbortController;let e=this._uiManager.combinedSignal(this.#i);this.editorDiv.addEventListener("keydown",this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener("focus",this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener("blur",this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener("input",this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener("paste",this.editorDivPaste.bind(this),{signal:e})}disableEditMode(){this.isInEditMode()&&(this.parent.setEditingState(!0),super.disableEditMode(),this.overlayDiv.classList.add("enabled"),this.editorDiv.contentEditable=!1,this.div.setAttribute("aria-activedescendant",this.#n),this._isDraggable=!0,this.#i?.abort(),this.#i=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add("freetextEditing"))}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(){this.width||(this.enableEditMode(),this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===""}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add("freetextEditing")),super.remove()}#c(){let e=[];this.editorDiv.normalize();let t=null;for(let i of this.editorDiv.childNodes)t?.nodeType===Node.TEXT_NODE&&i.nodeName==="BR"||(e.push(n.#a(i)),t=i);return e.join(` `)}#u(){let[e,t]=this.parentDimensions,i;if(this.isAttachedToDOM)i=this.div.getBoundingClientRect();else{let{currentLayer:r,div:s}=this,o=s.style.display,a=s.classList.contains("hidden");s.classList.remove("hidden"),s.style.display="hidden",r.div.append(this.div),i=s.getBoundingClientRect(),s.remove(),s.style.display=o,s.classList.toggle("hidden",a)}this.rotation%180===this.parentRotation%180?(this.width=i.width/e,this.height=i.height/t):(this.width=i.height/e,this.height=i.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let e=this.#t,t=this.#t=this.#c().trimEnd();if(e===t)return;let i=r=>{if(this.#t=r,!r){this.remove();return}this.#d(),this._uiManager.rebuild(this),this.#u()};this.addCommands({cmd:()=>{i(t)},undo:()=>{i(e)},mustExec:!1}),this.#u()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}dblclick(e){this.enterInEditMode()}keydown(e){e.target===this.div&&e.key==="Enter"&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(e){n._keyboardManager.exec(this,e)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle("freetextEditing",this.isEmpty())}disableEditing(){this.editorDiv.setAttribute("role","comment"),this.editorDiv.removeAttribute("aria-multiline")}enableEditing(){this.editorDiv.setAttribute("role","textbox"),this.editorDiv.setAttribute("aria-multiline",!0)}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement("div"),this.editorDiv.className="internal",this.editorDiv.setAttribute("id",this.#n),this.editorDiv.setAttribute("data-l10n-id","pdfjs-free-text2"),this.editorDiv.setAttribute("data-l10n-attrs","default-content"),this.enableEditing(),this.editorDiv.contentEditable=!0;let{style:i}=this.editorDiv;if(i.fontSize=`calc(${this.#r}px * var(--scale-factor))`,i.color=this.#e,this.div.append(this.editorDiv),this.overlayDiv=document.createElement("div"),this.overlayDiv.classList.add("overlay","enabled"),this.div.append(this.overlayDiv),Ld(this,this.div,["dblclick","keydown"]),this.width){let[r,s]=this.parentDimensions;if(this.annotationElementId){let{position:o}=this._initialData,[a,l]=this.getInitialTranslation();[a,l]=this.pageTranslationToScreen(a,l);let[c,u]=this.pageDimensions,[d,h]=this.pageTranslation,f,p;switch(this.rotation){case 0:f=e+(o[0]-d)/c,p=t+this.height-(o[1]-h)/u;break;case 90:f=e+(o[0]-d)/c,p=t-(o[1]-h)/u,[a,l]=[l,-a];break;case 180:f=e-this.width+(o[0]-d)/c,p=t-(o[1]-h)/u,[a,l]=[-a,-l];break;case 270:f=e+(o[0]-d-this.height*u)/c,p=t+(o[1]-h-this.width*c)/u,[a,l]=[-l,a];break}this.setAt(f*r,p*s,a,l)}else this.setAt(e*r,t*s,this.width*r,this.height*s);this.#d(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#a(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(Id,"")}editorDivPaste(e){let t=e.clipboardData||window.clipboardData,{types:i}=t;if(i.length===1&&i[0]==="text/plain")return;e.preventDefault();let r=n.#h(t.getData("text")||"").replaceAll(Id,` `);if(!r)return;let s=window.getSelection();if(!s.rangeCount)return;this.editorDiv.normalize(),s.deleteFromDocument();let o=s.getRangeAt(0);if(!r.includes(` `)){o.insertNode(document.createTextNode(r)),this.editorDiv.normalize(),s.collapseToStart();return}let{startContainer:a,startOffset:l}=o,c=[],u=[];if(a.nodeType===Node.TEXT_NODE){let f=a.parentElement;if(u.push(a.nodeValue.slice(l).replaceAll(Id,"")),f!==this.editorDiv){let p=c;for(let g of this.editorDiv.childNodes){if(g===f){p=u;continue}p.push(n.#a(g))}}c.push(a.nodeValue.slice(0,l).replaceAll(Id,""))}else if(a===this.editorDiv){let f=c,p=0;for(let g of this.editorDiv.childNodes)p++===l&&(f=u),f.push(n.#a(g))}this.#t=`${c.join(` `)}${r}${u.join(` `)}`,this.#d();let d=new Range,h=c.reduce((f,p)=>f+p.length,0);for(let{firstChild:f}of this.editorDiv.childNodes)if(f.nodeType===Node.TEXT_NODE){let p=f.nodeValue.length;if(h<=p){d.setStart(f,h),d.setEnd(f,h);break}h-=p}s.removeAllRanges(),s.addRange(d)}#d(){if(this.editorDiv.replaceChildren(),!!this.#t)for(let e of this.#t.split(` `)){let t=document.createElement("div");t.append(e?document.createTextNode(e):document.createElement("br")),this.editorDiv.append(t)}}#o(){return this.#t.replaceAll("\xA0"," ")}static#h(e){return e.replaceAll(" ","\xA0")}get contentDiv(){return this.editorDiv}static deserialize(e,t,i){return A(this,null,function*(){let r=null;if(e instanceof th){let{data:{defaultAppearanceData:{fontSize:o,fontColor:a},rect:l,rotation:c,id:u,popupRef:d},textContent:h,textPosition:f,parent:{page:{pageNumber:p}}}=e;if(!h||h.length===0)return null;r=e={annotationType:te.FREETEXT,color:Array.from(a),fontSize:o,value:h.join(` `),position:f,pageIndex:p-1,rect:l.slice(0),rotation:c,id:u,deleted:!1,popupRef:d}}let s=yield zr(n,this,"deserialize").call(this,e,t,i);return s.#r=e.fontSize,s.#e=B.makeHexColor(...e.color),s.#t=n.#h(e.value),s.annotationElementId=e.id||null,s._initialData=r,s})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let t=n._internalPadding*this.parentScale,i=this.getRect(t,t),r=_e._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.#e),s={annotationType:te.FREETEXT,color:r,fontSize:this.#r,value:this.#o(),pageIndex:this.pageIndex,rect:i,rotation:this.rotation,structTreeParentId:this._structTreeParentId};return e?s:this.annotationElementId&&!this.#p(s)?null:(s.id=this.annotationElementId,s)}#p(e){let{value:t,fontSize:i,color:r,pageIndex:s}=this._initialData;return this._hasBeenMoved||e.value!==t||e.fontSize!==i||e.color.some((o,a)=>o!==r[a])||e.pageIndex!==s}renderAnnotationElement(e){let t=super.renderAnnotationElement(e);if(this.deleted)return t;let{style:i}=t;i.fontSize=`calc(${this.#r}px * var(--scale-factor))`,i.color=this.#e,t.replaceChildren();for(let s of this.#t.split(` `)){let o=document.createElement("div");o.append(s?document.createTextNode(s):document.createElement("br")),t.append(o)}let r=n._internalPadding*this.parentScale;return e.updateEdited({rect:this.getRect(r,r),popupContent:this.#t}),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}},sh=class{toSVGPath(){Pe("Abstract method `toSVGPath` must be implemented.")}get box(){Pe("Abstract getter `box` must be implemented.")}serialize(e,t){Pe("Abstract method `serialize` must be implemented.")}get classNamesForDrawing(){Pe("Abstract getter `classNamesForDrawing` must be implemented.")}get classNamesForOutlining(){Pe("Abstract getter `classNamesForOutlining` must be implemented.")}get mustRemoveSelfIntersections(){return!1}},oh=class n{#e;#t=[];#n;#i;#r=[];#s=new Float64Array(18);#l;#c;#u;#a;#d;#o;#h=[];static#p=8;static#f=2;static#g=n.#p+n.#f;constructor({x:e,y:t},i,r,s,o,a=0){this.#e=i,this.#o=s*r,this.#i=o,this.#s.set([NaN,NaN,NaN,NaN,e,t],6),this.#n=a,this.#a=n.#p*r,this.#u=n.#g*r,this.#d=r,this.#h.push(e,t)}isEmpty(){return isNaN(this.#s[8])}#v(){let e=this.#s.subarray(4,6),t=this.#s.subarray(16,18),[i,r,s,o]=this.#e;return[(this.#l+(e[0]-t[0])/2-i)/s,(this.#c+(e[1]-t[1])/2-r)/o,(this.#l+(t[0]-e[0])/2-i)/s,(this.#c+(t[1]-e[1])/2-r)/o]}add({x:e,y:t}){this.#l=e,this.#c=t;let[i,r,s,o]=this.#e,[a,l,c,u]=this.#s.subarray(8,12),d=e-c,h=t-u,f=Math.hypot(d,h);if(f=6;r-=6)isNaN(t[r])?i.push(`L${t[r+4]} ${t[r+5]}`):i.push(`C${t[r]} ${t[r+1]} ${t[r+2]} ${t[r+3]} ${t[r+4]} ${t[r+5]}`);return this.#y(i),i.join(" ")}#m(){let[e,t,i,r]=this.#e,[s,o,a,l]=this.#v();return`M${(this.#s[2]-e)/i} ${(this.#s[3]-t)/r} L${(this.#s[4]-e)/i} ${(this.#s[5]-t)/r} L${s} ${o} L${a} ${l} L${(this.#s[16]-e)/i} ${(this.#s[17]-t)/r} L${(this.#s[14]-e)/i} ${(this.#s[15]-t)/r} Z`}#y(e){let t=this.#t;e.push(`L${t[4]} ${t[5]} Z`)}#w(e){let[t,i,r,s]=this.#e,o=this.#s.subarray(4,6),a=this.#s.subarray(16,18),[l,c,u,d]=this.#v();e.push(`L${(o[0]-t)/r} ${(o[1]-i)/s} L${l} ${c} L${u} ${d} L${(a[0]-t)/r} ${(a[1]-i)/s}`)}newFreeDrawOutline(e,t,i,r,s,o){return new ah(e,t,i,r,s,o)}getOutlines(){let e=this.#r,t=this.#t,i=this.#s,[r,s,o,a]=this.#e,l=new Float64Array((this.#h?.length??0)+2);for(let d=0,h=l.length-2;d=6;d-=6)for(let h=0;h<6;h+=2){if(isNaN(t[d+h])){c[u]=c[u+1]=NaN,u+=2;continue}c[u]=t[d+h],c[u+1]=t[d+h+1],u+=2}return this.#_(c,u),this.newFreeDrawOutline(c,l,this.#e,this.#d,this.#n,this.#i)}#C(e){let t=this.#s,[i,r,s,o]=this.#e,[a,l,c,u]=this.#v(),d=new Float64Array(36);return d.set([NaN,NaN,NaN,NaN,(t[2]-i)/s,(t[3]-r)/o,NaN,NaN,NaN,NaN,(t[4]-i)/s,(t[5]-r)/o,NaN,NaN,NaN,NaN,a,l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,(t[16]-i)/s,(t[17]-r)/o,NaN,NaN,NaN,NaN,(t[14]-i)/s,(t[15]-r)/o],0),this.newFreeDrawOutline(d,e,this.#e,this.#d,this.#n,this.#i)}#_(e,t){let i=this.#t;return e.set([NaN,NaN,NaN,NaN,i[4],i[5]],t),t+=6}#E(e,t){let i=this.#s.subarray(4,6),r=this.#s.subarray(16,18),[s,o,a,l]=this.#e,[c,u,d,h]=this.#v();return e.set([NaN,NaN,NaN,NaN,(i[0]-s)/a,(i[1]-o)/l,NaN,NaN,NaN,NaN,c,u,NaN,NaN,NaN,NaN,d,h,NaN,NaN,NaN,NaN,(r[0]-s)/a,(r[1]-o)/l],t),t+=24}},ah=class extends sh{#e;#t=null;#n;#i;#r;#s;#l;constructor(e,t,i,r,s,o){super(),this.#l=e,this.#r=t,this.#e=i,this.#s=r,this.#n=s,this.#i=o,this.#a(o);let{x:a,y:l,width:c,height:u}=this.#t;for(let d=0,h=e.length;dt[0]-i[0]||t[1]-i[1]||t[2]-i[2]);let e=[];for(let t of this.#t)t[3]?(e.push(...this.#c(t)),this.#s(t)):(this.#l(t),e.push(...this.#c(t)));return this.#i(e)}#i(e){let t=[],i=new Set;for(let o of e){let[a,l,c]=o;t.push([a,l,o],[a,c,o])}t.sort((o,a)=>o[1]-a[1]||o[0]-a[0]);for(let o=0,a=t.length;o0;){let o=i.values().next().value,[a,l,c,u,d]=o;i.delete(o);let h=a,f=l;for(s=[a,c],r.push(s);;){let p;if(i.has(u))p=u;else if(i.has(d))p=d;else break;i.delete(p),[a,l,c,u,d]=p,h!==a&&(s.push(h,f,a,f===l?l:c),h=a),f=f===l?c:l}s.push(h,f)}return new py(r,this.#e)}#r(e){let t=this.#n,i=0,r=t.length-1;for(;i<=r;){let s=i+r>>1,o=t[s][0];if(o===e)return s;o=0;r--){let[s,o]=this.#n[r];if(s!==e)break;if(s===e&&o===t){this.#n.splice(r,1);return}}}#c(e){let[t,i,r]=e,s=[[t,i,r]],o=this.#r(r);for(let a=0;a=l){if(f>c)s[u][1]=c;else{if(d===1)return[];s.splice(u,1),u--,d--}continue}s[u][2]=l,f>c&&s.push([t,c,f])}}}return s}},py=class extends sh{#e;#t;constructor(e,t){super(),this.#t=e,this.#e=t}toSVGPath(){let e=[];for(let t of this.#t){let[i,r]=t;e.push(`M${i} ${r}`);for(let s=2;s-1?(this.#o=!0,this.#w(e),this.#x()):this.#n&&(this.#e=e.anchorNode,this.#t=e.anchorOffset,this.#l=e.focusNode,this.#c=e.focusOffset,this.#y(),this.#x(),this.rotate(this.rotation))}get telemetryInitialData(){return{action:"added",type:this.#o?"free_highlight":"highlight",color:this._uiManager.highlightColorNames.get(this.color),thickness:this.#v,methodOfCreation:this.#m}}get telemetryFinalData(){return{type:"highlight",color:this._uiManager.highlightColorNames.get(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get("color").size}}#y(){let e=new lh(this.#n,.001);this.#a=e.getOutlines(),{x:this.x,y:this.y,width:this.width,height:this.height}=this.#a.box;let t=new lh(this.#n,.0025,.001,this._uiManager.direction==="ltr");this.#s=t.getOutlines();let{lastPoint:i}=this.#s.box;this.#h=[(i[0]-this.x)/this.width,(i[1]-this.y)/this.height]}#w({highlightOutlines:e,highlightId:t,clipPathId:i}){this.#a=e;let r=1.5;if(this.#s=e.getNewOutline(this.#v/2+r,.0025),t>=0)this.#d=t,this.#i=i,this.parent.drawLayer.finalizeLine(t,e),this.#f=this.parent.drawLayer.drawOutline(this.#s);else if(this.parent){let u=this.parent.viewport.rotation;this.parent.drawLayer.updateLine(this.#d,e),this.parent.drawLayer.updateBox(this.#d,n.#A(this.#a.box,(u-this.rotation+360)%360)),this.parent.drawLayer.updateLine(this.#f,this.#s),this.parent.drawLayer.updateBox(this.#f,n.#A(this.#s.box,u))}let{x:s,y:o,width:a,height:l}=e.box;switch(this.rotation){case 0:this.x=s,this.y=o,this.width=a,this.height=l;break;case 90:{let[u,d]=this.parentDimensions;this.x=o,this.y=1-s,this.width=a*d/u,this.height=l*u/d;break}case 180:this.x=1-s,this.y=1-o,this.width=a,this.height=l;break;case 270:{let[u,d]=this.parentDimensions;this.x=1-o,this.y=s,this.width=a*d/u,this.height=l*u/d;break}}let{lastPoint:c}=this.#s.box;this.#h=[(c[0]-s)/a,(c[1]-o)/l]}static initialize(e,t){_e.initialize(e,t),n._defaultColor||=t.highlightColors?.values().next().value||"#fff066"}static updateDefaultParams(e,t){switch(e){case q.HIGHLIGHT_DEFAULT_COLOR:n._defaultColor=t;break;case q.HIGHLIGHT_THICKNESS:n._defaultThickness=t;break}}translateInPage(e,t){}get toolbarPosition(){return this.#h}updateParams(e,t){switch(e){case q.HIGHLIGHT_COLOR:this.#C(t);break;case q.HIGHLIGHT_THICKNESS:this.#_(t);break}}static get defaultPropertiesToUpdate(){return[[q.HIGHLIGHT_DEFAULT_COLOR,n._defaultColor],[q.HIGHLIGHT_THICKNESS,n._defaultThickness]]}get propertiesToUpdate(){return[[q.HIGHLIGHT_COLOR,this.color||n._defaultColor],[q.HIGHLIGHT_THICKNESS,this.#v||n._defaultThickness],[q.HIGHLIGHT_FREE,this.#o]]}#C(e){let t=(s,o)=>{this.color=s,this.parent?.drawLayer.changeColor(this.#d,s),this.#r?.updateColor(s),this.#p=o,this.parent?.drawLayer.changeOpacity(this.#d,o)},i=this.color,r=this.#p;this.addCommands({cmd:t.bind(this,e,n._defaultOpacity),undo:t.bind(this,i,r),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:q.HIGHLIGHT_COLOR,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"color_changed",color:this._uiManager.highlightColorNames.get(e)},!0)}#_(e){let t=this.#v,i=r=>{this.#v=r,this.#E(r)};this.addCommands({cmd:i.bind(this,e),undo:i.bind(this,t),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:q.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0}),this._reportTelemetry({action:"thickness_changed",thickness:e},!0)}addEditToolbar(){return A(this,null,function*(){let e=yield zr(n.prototype,this,"addEditToolbar").call(this);return e?(this._uiManager.highlightColors&&(this.#r=new ch({editor:this}),e.addColorPicker(this.#r)),e):null})}disableEditing(){super.disableEditing(),this.div.classList.toggle("disabled",!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle("disabled",!1)}fixAndSetPosition(){return super.fixAndSetPosition(this.#R())}getBaseTranslation(){return[0,0]}getRect(e,t){return super.getRect(e,t,this.#R())}onceAdded(){this.annotationElementId||this.parent.addUndoableEditor(this),this.div.focus()}remove(){this.#M(),this._reportTelemetry({action:"deleted"}),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#x(),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?this.#M():e&&(this.#x(e),t=!this.parent&&this.div?.classList.contains("selectedEditor")),super.setParent(e),this.show(this._isVisible),t&&this.select()}#E(e){if(!this.#o)return;this.#w({highlightOutlines:this.#a.getNewOutline(e/2)}),this.fixAndSetPosition();let[t,i]=this.parentDimensions;this.setDims(this.width*t,this.height*i)}#M(){this.#d===null||!this.parent||(this.parent.drawLayer.remove(this.#d),this.#d=null,this.parent.drawLayer.remove(this.#f),this.#f=null)}#x(e=this.parent){this.#d===null&&({id:this.#d,clipPathId:this.#i}=e.drawLayer.draw(this.#a,this.color,this.#p),this.#f=e.drawLayer.drawOutline(this.#s),this.#u&&(this.#u.style.clipPath=this.#i))}static#A({x:e,y:t,width:i,height:r},s){switch(s){case 90:return{x:1-t-r,y:e,width:r,height:i};case 180:return{x:1-e-i,y:1-t-r,width:i,height:r};case 270:return{x:t,y:1-e-i,width:r,height:i}}return{x:e,y:t,width:i,height:r}}rotate(e){let{drawLayer:t}=this.parent,i;this.#o?(e=(e-this.rotation+360)%360,i=n.#A(this.#a.box,e)):i=n.#A(this,e),t.rotate(this.#d,e),t.rotate(this.#f,e),t.updateBox(this.#d,i),t.updateBox(this.#f,n.#A(this.#s.box,e))}render(){if(this.div)return this.div;let e=super.render();this.#g&&(e.setAttribute("aria-label",this.#g),e.setAttribute("role","mark")),this.#o?e.classList.add("free"):this.div.addEventListener("keydown",this.#I.bind(this),{signal:this._uiManager._signal});let t=this.#u=document.createElement("div");e.append(t),t.setAttribute("aria-hidden","true"),t.className="internal",t.style.clipPath=this.#i;let[i,r]=this.parentDimensions;return this.setDims(this.width*i,this.height*r),Ld(this,this.#u,["pointerover","pointerleave"]),this.enableEditing(),e}pointerover(){this.isSelected||this.parent.drawLayer.addClass(this.#f,"hovered")}pointerleave(){this.isSelected||this.parent.drawLayer.removeClass(this.#f,"hovered")}#I(e){n._keyboardManager.exec(this,e)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#S(!0);break;case 1:case 3:this.#S(!1);break}}#S(e){if(!this.#e)return;let t=window.getSelection();e?t.setPosition(this.#e,this.#t):t.setPosition(this.#l,this.#c)}select(){super.select(),this.#f&&(this.parent?.drawLayer.removeClass(this.#f,"hovered"),this.parent?.drawLayer.addClass(this.#f,"selected"))}unselect(){super.unselect(),this.#f&&(this.parent?.drawLayer.removeClass(this.#f,"selected"),this.#o||this.#S(!1))}get _mustFixPosition(){return!this.#o}show(e=this._isVisible){super.show(e),this.parent&&(this.parent.drawLayer.show(this.#d,e),this.parent.drawLayer.show(this.#f,e))}#R(){return this.#o?this.rotation:0}#N(){if(this.#o)return null;let[e,t]=this.pageDimensions,[i,r]=this.pageTranslation,s=this.#n,o=new Float32Array(s.length*8),a=0;for(let{x:l,y:c,width:u,height:d}of s){let h=l*e+i,f=(1-c-d)*t+r;o[a]=o[a+4]=h,o[a+1]=o[a+3]=f,o[a+2]=o[a+6]=h+u*e,o[a+5]=o[a+7]=f+d*t,a+=8}return o}#D(e){return this.#a.serialize(e,this.#R())}static startHighlighting(e,t,{target:i,x:r,y:s}){let{x:o,y:a,width:l,height:c}=i.getBoundingClientRect(),u=new AbortController,d=e.combinedSignal(u),h=p=>{p.preventDefault(),p.stopPropagation()},f=p=>{u.abort(),this.#T(e,p)};window.addEventListener("blur",f,{signal:d}),window.addEventListener("pointerup",f,{signal:d}),window.addEventListener("pointerdown",h,{capture:!0,passive:!1,signal:d}),window.addEventListener("contextmenu",hn,{signal:d}),i.addEventListener("pointermove",this.#b.bind(this,e),{signal:d}),this._freeHighlight=new sl({x:r,y:s},[o,a,l,c],e.scale,this._defaultThickness/2,t,.001),{id:this._freeHighlightId,clipPathId:this._freeHighlightClipId}=e.drawLayer.draw(this._freeHighlight,this._defaultColor,this._defaultOpacity,!0)}static#b(e,t){this._freeHighlight.add(t)&&e.drawLayer.updatePath(this._freeHighlightId,this._freeHighlight)}static#T(e,t){this._freeHighlight.isEmpty()?e.drawLayer.remove(this._freeHighlightId):e.createAndAddNewEditor(t,!1,{highlightId:this._freeHighlightId,highlightOutlines:this._freeHighlight.getOutlines(),clipPathId:this._freeHighlightClipId,methodOfCreation:"main_toolbar"}),this._freeHighlightId=-1,this._freeHighlight=null,this._freeHighlightClipId=""}static deserialize(e,t,i){return A(this,null,function*(){let r=null;if(e instanceof ih){let{data:{quadPoints:p,rect:g,rotation:v,id:m,color:y,opacity:b,popupRef:w},parent:{page:{pageNumber:E}}}=e;r=e={annotationType:te.HIGHLIGHT,color:Array.from(y),opacity:b,quadPoints:p,boxes:null,pageIndex:E-1,rect:g.slice(0),rotation:v,id:m,deleted:!1,popupRef:w}}else if(e instanceof rl){let{data:{inkLists:p,rect:g,rotation:v,id:m,color:y,borderStyle:{rawWidth:b},popupRef:w},parent:{page:{pageNumber:E}}}=e;r=e={annotationType:te.HIGHLIGHT,color:Array.from(y),thickness:b,inkLists:p,boxes:null,pageIndex:E-1,rect:g.slice(0),rotation:v,id:m,deleted:!1,popupRef:w}}let{color:s,quadPoints:o,inkLists:a,opacity:l}=e,c=yield zr(n,this,"deserialize").call(this,e,t,i);c.color=B.makeHexColor(...s),c.#p=l||1,a&&(c.#v=e.thickness),c.annotationElementId=e.id||null,c._initialData=r;let[u,d]=c.pageDimensions,[h,f]=c.pageTranslation;if(o){let p=c.#n=[];for(let g=0;gi!==t[r])}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}static canCreateNewEmptyEditor(){return!1}},my=class n extends _e{#e=0;#t=0;#n=null;#i=new Path2D;#r=!1;#s=null;#l=!1;#c=!1;#u=null;#a=null;#d=0;#o=0;#h=null;static _defaultColor=null;static _defaultOpacity=1;static _defaultThickness=1;static _type="ink";static _editorType=te.INK;constructor(e){super(G(x({},e),{name:"inkEditor"})),this.color=e.color||null,this.thickness=e.thickness||null,this.opacity=e.opacity||null,this.paths=[],this.bezierPath2D=[],this.allRawPaths=[],this.currentPath=[],this.scaleFactor=1,this.translationX=this.translationY=0,this.x=0,this.y=0,this._willKeepAspectRatio=!0}static initialize(e,t){_e.initialize(e,t)}static updateDefaultParams(e,t){switch(e){case q.INK_THICKNESS:n._defaultThickness=t;break;case q.INK_COLOR:n._defaultColor=t;break;case q.INK_OPACITY:n._defaultOpacity=t/100;break}}updateParams(e,t){switch(e){case q.INK_THICKNESS:this.#p(t);break;case q.INK_COLOR:this.#f(t);break;case q.INK_OPACITY:this.#g(t);break}}static get defaultPropertiesToUpdate(){return[[q.INK_THICKNESS,n._defaultThickness],[q.INK_COLOR,n._defaultColor||_e._defaultLineColor],[q.INK_OPACITY,Math.round(n._defaultOpacity*100)]]}get propertiesToUpdate(){return[[q.INK_THICKNESS,this.thickness||n._defaultThickness],[q.INK_COLOR,this.color||n._defaultColor||_e._defaultLineColor],[q.INK_OPACITY,Math.round(100*(this.opacity??n._defaultOpacity))]]}#p(e){let t=r=>{this.thickness=r,this.#k()},i=this.thickness;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:q.INK_THICKNESS,overwriteIfSameType:!0,keepUndo:!0})}#f(e){let t=r=>{this.color=r,this.#A()},i=this.color;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:q.INK_COLOR,overwriteIfSameType:!0,keepUndo:!0})}#g(e){let t=r=>{this.opacity=r,this.#A()};e/=100;let i=this.opacity;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:q.INK_OPACITY,overwriteIfSameType:!0,keepUndo:!0})}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.canvas||(this.#N(),this.#D()),this.isAttachedToDOM||(this.parent.add(this),this.#b()),this.#k()))}remove(){this.canvas!==null&&(this.isEmpty()||this.commit(),this.canvas.width=this.canvas.height=0,this.canvas.remove(),this.canvas=null,this.#n&&(clearTimeout(this.#n),this.#n=null),this.#u?.disconnect(),this.#u=null,super.remove())}setParent(e){!this.parent&&e?this._uiManager.removeShouldRescale(this):this.parent&&e===null&&this._uiManager.addShouldRescale(this),super.setParent(e)}onScaleChanging(){let[e,t]=this.parentDimensions,i=this.width*e,r=this.height*t;this.setDimensions(i,r)}enableEditMode(){this.#r||this.canvas===null||(super.enableEditMode(),this._isDraggable=!1,this.#I())}disableEditMode(){!this.isInEditMode()||this.canvas===null||(super.disableEditMode(),this._isDraggable=!this.isEmpty(),this.div.classList.remove("editing"),this.#S())}onceAdded(){this._isDraggable=!this.isEmpty()}isEmpty(){return this.paths.length===0||this.paths.length===1&&this.paths[0].length===0}#v(){let{parentRotation:e,parentDimensions:[t,i]}=this;switch(e){case 90:return[0,i,i,t];case 180:return[t,i,t,i];case 270:return[t,0,i,t];default:return[0,0,t,i]}}#m(){let{ctx:e,color:t,opacity:i,thickness:r,parentScale:s,scaleFactor:o}=this;e.lineWidth=r*s/o,e.lineCap="round",e.lineJoin="round",e.miterLimit=10,e.strokeStyle=`${t}${FL(i)}`}#y(e,t){this.canvas.addEventListener("contextmenu",hn,{signal:this._uiManager._signal}),this.#S(),this.#s=new AbortController;let i=this._uiManager.combinedSignal(this.#s);this.canvas.addEventListener("pointerleave",this.canvasPointerleave.bind(this),{signal:i}),this.canvas.addEventListener("pointermove",this.canvasPointermove.bind(this),{signal:i}),this.canvas.addEventListener("pointerup",this.canvasPointerup.bind(this),{signal:i}),this.isEditing=!0,this.#c||(this.#c=!0,this.#b(),this.thickness||=n._defaultThickness,this.color||=n._defaultColor||_e._defaultLineColor,this.opacity??=n._defaultOpacity),this.currentPath.push([e,t]),this.#l=!1,this.#m(),this.#h=()=>{this.#E(),this.#h&&window.requestAnimationFrame(this.#h)},window.requestAnimationFrame(this.#h)}#w(e,t){let[i,r]=this.currentPath.at(-1);if(this.currentPath.length>1&&e===i&&t===r)return;let s=this.currentPath,o=this.#i;if(s.push([e,t]),this.#l=!0,s.length<=2){o.moveTo(...s[0]),o.lineTo(e,t);return}s.length===3&&(this.#i=o=new Path2D,o.moveTo(...s[0])),this.#M(o,...s.at(-3),...s.at(-2),e,t)}#C(){if(this.currentPath.length===0)return;let e=this.currentPath.at(-1);this.#i.lineTo(...e)}#_(e,t){this.#h=null,e=Math.min(Math.max(e,0),this.canvas.width),t=Math.min(Math.max(t,0),this.canvas.height),this.#w(e,t),this.#C();let i;if(this.currentPath.length!==1)i=this.#x();else{let l=[e,t];i=[[l,l.slice(),l.slice(),l]]}let r=this.#i,s=this.currentPath;this.currentPath=[],this.#i=new Path2D;let o=()=>{this.allRawPaths.push(s),this.paths.push(i),this.bezierPath2D.push(r),this._uiManager.rebuild(this)},a=()=>{this.allRawPaths.pop(),this.paths.pop(),this.bezierPath2D.pop(),this.paths.length===0?this.remove():(this.canvas||(this.#N(),this.#D()),this.#k())};this.addCommands({cmd:o,undo:a,mustExec:!0})}#E(){if(!this.#l)return;this.#l=!1;let e=Math.ceil(this.thickness*this.parentScale),t=this.currentPath.slice(-3),i=t.map(u=>u[0]),r=t.map(u=>u[1]),s=Math.min(...i)-e,o=Math.max(...i)+e,a=Math.min(...r)-e,l=Math.max(...r)+e,{ctx:c}=this;c.save(),c.clearRect(0,0,this.canvas.width,this.canvas.height);for(let u of this.bezierPath2D)c.stroke(u);c.stroke(this.#i),c.restore()}#M(e,t,i,r,s,o,a){let l=(t+r)/2,c=(i+s)/2,u=(r+o)/2,d=(s+a)/2;e.bezierCurveTo(l+2*(r-l)/3,c+2*(s-c)/3,u+2*(r-u)/3,d+2*(s-d)/3,u,d)}#x(){let e=this.currentPath;if(e.length<=2)return[[e[0],e[0],e.at(-1),e.at(-1)]];let t=[],i,[r,s]=e[0];for(i=1;i{this.#n=null,this.canvas.removeEventListener("contextmenu",hn)},10),this.#_(e.offsetX,e.offsetY),this.addToAnnotationStorage(),this.setInBackground()}#N(){this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=0,this.canvas.className="inkEditorCanvas",this.canvas.setAttribute("data-l10n-id","pdfjs-ink-canvas"),this.div.append(this.canvas),this.ctx=this.canvas.getContext("2d")}#D(){this.#u=new ResizeObserver(e=>{let t=e[0].contentRect;t.width&&t.height&&this.setDimensions(t.width,t.height)}),this.#u.observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{this.#u?.disconnect(),this.#u=null},{once:!0})}get isResizable(){return!this.isEmpty()&&this.#r}render(){if(this.div)return this.div;let e,t;this.width&&(e=this.x,t=this.y),super.render(),this.div.setAttribute("data-l10n-id","pdfjs-ink");let[i,r,s,o]=this.#v();if(this.setAt(i,r,0,0),this.setDims(s,o),this.#N(),this.width){let[a,l]=this.parentDimensions;this.setAspectRatio(this.width*a,this.height*l),this.setAt(e*a,t*l,this.width*a,this.height*l),this.#c=!0,this.#b(),this.setDims(this.width*a,this.height*l),this.#A(),this.div.classList.add("disabled")}else this.div.classList.add("editing"),this.enableEditMode();return this.#D(),this.div}#b(){if(!this.#c)return;let[e,t]=this.parentDimensions;this.canvas.width=Math.ceil(this.width*e),this.canvas.height=Math.ceil(this.height*t),this.#P()}setDimensions(e,t){let i=Math.round(e),r=Math.round(t);if(this.#d===i&&this.#o===r)return;this.#d=i,this.#o=r,this.canvas.style.visibility="hidden";let[s,o]=this.parentDimensions;this.width=e/s,this.height=t/o,this.fixAndSetPosition(),this.#r&&this.#T(e,t),this.#b(),this.#A(),this.canvas.style.visibility="visible",this.fixDims()}#T(e,t){let i=this.#j(),r=(e-i)/this.#t,s=(t-i)/this.#e;this.scaleFactor=Math.min(r,s)}#P(){let e=this.#j()/2;this.ctx.setTransform(this.scaleFactor,0,0,this.scaleFactor,this.translationX*this.scaleFactor+e,this.translationY*this.scaleFactor+e)}static#F(e){let t=new Path2D;for(let i=0,r=e.length;i`image/${t}`))}static get supportedTypesStr(){return de(this,"supportedTypesStr",this.supportedTypes.join(","))}static isHandlingMimeForPasting(e){return this.supportedTypes.includes(e)}static paste(e,t){t.pasteEditor(te.STAMP,{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:"stamp",hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){let t=e.get("hasAltText");return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}#o(e,t=!1){if(!e){this.remove();return}this.#e=e.bitmap,t||(this.#t=e.id,this.#a=e.isSvg),e.file&&(this.#s=e.file.name),this.#f()}#h(){if(this.#n=null,this._uiManager.enableWaiting(!1),!!this.#l){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this._editToolbar.hide(),this._uiManager.editAltText(this,!0);return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this._reportTelemetry({action:"pdfjs.image.image_added",data:{alt_text_modal:!1,alt_text_type:"empty"}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}mlGuessAltText(e=null,t=!0){return A(this,null,function*(){if(this.hasAltTextData())return null;let{mlManager:i}=this._uiManager;if(!i)throw new Error("No ML.");if(!(yield i.isEnabledFor("altText")))throw new Error("ML isn't enabled for alt text.");let{data:r,width:s,height:o}=e||this.copyCanvas(null,null,!0).imageData,a=yield i.guess({name:"altText",request:{data:r,width:s,height:o,channels:r.length/(s*o)}});if(!a)throw new Error("No response from the AI service.");if(a.error)throw new Error("Error from the AI service.");if(a.cancel)return null;if(!a.output)throw new Error("No valid response from the AI service.");let l=a.output;return yield this.setGuessedAltText(l),t&&!this.hasAltTextData()&&(this.altTextData={alt:l,decorative:!1}),l})}#p(){if(this.#t){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#t).then(i=>this.#o(i,!0)).finally(()=>this.#h());return}if(this.#i){let i=this.#i;this.#i=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromUrl(i).then(r=>this.#o(r)).finally(()=>this.#h());return}if(this.#r){let i=this.#r;this.#r=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromFile(i).then(r=>this.#o(r)).finally(()=>this.#h());return}let e=document.createElement("input");e.type="file",e.accept=n.supportedTypesStr;let t=this._uiManager._signal;this.#n=new Promise(i=>{e.addEventListener("change",()=>A(this,null,function*(){if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);let r=yield this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:"pdfjs.image.image_selected",data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#o(r)}i()}),{signal:t}),e.addEventListener("cancel",()=>{this.remove(),i()},{signal:t})}).finally(()=>this.#h()),e.click()}remove(){this.#t&&(this.#e=null,this._uiManager.imageManager.deleteId(this.#t),this.#l?.remove(),this.#l=null,this.#c?.disconnect(),this.#c=null,this.#u&&(clearTimeout(this.#u),this.#u=null)),super.remove()}rebuild(){if(!this.parent){this.#t&&this.#p();return}super.rebuild(),this.div!==null&&(this.#t&&this.#l===null&&this.#p(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(){this._isDraggable=!0,this.div.focus()}isEmpty(){return!(this.#n||this.#e||this.#i||this.#r||this.#t)}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;if(this.width&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.div.setAttribute("role","figure"),this.addAltTextButton(),this.#e?this.#f():this.#p(),this.width&&!this.annotationElementId){let[i,r]=this.parentDimensions;this.setAt(e*i,t*r,this.width*i,this.height*r)}return this.div}#f(){let{div:e}=this,{width:t,height:i}=this.#e,[r,s]=this.pageDimensions,o=.75;if(this.width)t=this.width*r,i=this.height*s;else if(t>o*r||i>o*s){let u=Math.min(o*r/t,o*s/i);t*=u,i*=u}let[a,l]=this.parentDimensions;this.setDims(t*a/r,i*l/s),this._uiManager.enableWaiting(!1);let c=this.#l=document.createElement("canvas");c.setAttribute("role","img"),this.addContainer(c),(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),this.#m(t,i),this.#w(),this.#d||(this.parent.addUndoableEditor(this),this.#d=!0),this._reportTelemetry({action:"inserted_image"}),this.#s&&c.setAttribute("aria-label",this.#s)}copyCanvas(e,t,i=!1){e||(e=224);let{width:r,height:s}=this.#e,o=new Ka,a=this.#e,l=r,c=s,u=null;if(t){if(r>t||s>t){let S=Math.min(t/r,t/s);l=Math.floor(r*S),c=Math.floor(s*S)}u=document.createElement("canvas");let h=u.width=Math.ceil(l*o.sx),f=u.height=Math.ceil(c*o.sy);this.#a||(a=this.#v(h,f));let p=u.getContext("2d");p.filter=this._uiManager.hcmFilter;let g="white",v="#cfcfd8";this._uiManager.hcmFilter!=="none"?v="black":window.matchMedia?.("(prefers-color-scheme: dark)").matches&&(g="#8f8f9d",v="#42414d");let m=15,y=m*o.sx,b=m*o.sy,w=new OffscreenCanvas(y*2,b*2),E=w.getContext("2d");E.fillStyle=g,E.fillRect(0,0,y*2,b*2),E.fillStyle=v,E.fillRect(0,0,y,b),E.fillRect(y,b,y,b),p.fillStyle=p.createPattern(w,"repeat"),p.fillRect(0,0,h,f),p.drawImage(a,0,0,a.width,a.height,0,0,h,f)}let d=null;if(i){let h,f;if(o.symmetric&&a.widthe||s>e){let v=Math.min(e/r,e/s);h=Math.floor(r*v),f=Math.floor(s*v),this.#a||(a=this.#v(h,f))}let g=new OffscreenCanvas(h,f).getContext("2d",{willReadFrequently:!0});g.drawImage(a,0,0,a.width,a.height,0,0,h,f),d={width:h,height:f,data:g.getImageData(0,0,h,f).data}}return{canvas:u,width:l,height:c,imageData:d}}#g(e,t){let[i,r]=this.parentDimensions;this.width=e/i,this.height=t/r,this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,this.#u!==null&&clearTimeout(this.#u);let s=200;this.#u=setTimeout(()=>{this.#u=null,this.#m(e,t)},s)}#v(e,t){let{width:i,height:r}=this.#e,s=i,o=r,a=this.#e;for(;s>2*e||o>2*t;){let l=s,c=o;s>2*e&&(s=s>=16384?Math.floor(s/2)-1:Math.ceil(s/2)),o>2*t&&(o=o>=16384?Math.floor(o/2)-1:Math.ceil(o/2));let u=new OffscreenCanvas(s,o);u.getContext("2d").drawImage(a,0,0,l,c,0,0,s,o),a=u.transferToImageBitmap()}return a}#m(e,t){let i=new Ka,r=Math.ceil(e*i.sx),s=Math.ceil(t*i.sy),o=this.#l;if(!o||o.width===r&&o.height===s)return;o.width=r,o.height=s;let a=this.#a?this.#e:this.#v(r,s),l=o.getContext("2d");l.filter=this._uiManager.hcmFilter,l.drawImage(a,0,0,a.width,a.height,0,0,r,s)}getImageForAltText(){return this.#l}#y(e){if(e){if(this.#a){let r=this._uiManager.imageManager.getSvgUrl(this.#t);if(r)return r}let t=document.createElement("canvas");return{width:t.width,height:t.height}=this.#e,t.getContext("2d").drawImage(this.#e,0,0),t.toDataURL()}if(this.#a){let[t,i]=this.pageDimensions,r=Math.round(this.width*t*Gi.PDF_TO_CSS_UNITS),s=Math.round(this.height*i*Gi.PDF_TO_CSS_UNITS),o=new OffscreenCanvas(r,s);return o.getContext("2d").drawImage(this.#e,0,0,this.#e.width,this.#e.height,0,0,r,s),o.transferToImageBitmap()}return structuredClone(this.#e)}#w(){this._uiManager._signal&&(this.#c=new ResizeObserver(e=>{let t=e[0].contentRect;t.width&&t.height&&this.#g(t.width,t.height)}),this.#c.observe(this.div),this._uiManager._signal.addEventListener("abort",()=>{this.#c?.disconnect(),this.#c=null},{once:!0}))}static deserialize(e,t,i){return A(this,null,function*(){let r=null;if(e instanceof rh){let{data:{rect:p,rotation:g,id:v,structParent:m,popupRef:y},container:b,parent:{page:{pageNumber:w}}}=e,E=b.querySelector("canvas"),S=i.imageManager.getFromCanvas(b.id,E);E.remove();let I=(yield t._structTree.getAriaAttributes(`${wy}${v}`))?.get("aria-label")||"";r=e={annotationType:te.STAMP,bitmapId:S.id,bitmap:S.bitmap,pageIndex:w-1,rect:p.slice(0),rotation:g,id:v,deleted:!1,accessibilityData:{decorative:!1,altText:I},isSvg:!1,structParent:m,popupRef:y}}let s=yield zr(n,this,"deserialize").call(this,e,t,i),{rect:o,bitmap:a,bitmapUrl:l,bitmapId:c,isSvg:u,accessibilityData:d}=e;c&&i.imageManager.isValidId(c)?(s.#t=c,a&&(s.#e=a)):s.#i=l,s.#a=u;let[h,f]=s.pageDimensions;return s.width=(o[2]-o[0])/h,s.height=(o[3]-o[1])/f,s.annotationElementId=e.id||null,d&&(s.altTextData=d),s._initialData=r,s.#d=!!r,s})}serialize(e=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let i={annotationType:te.STAMP,bitmapId:this.#t,pageIndex:this.pageIndex,rect:this.getRect(0,0),rotation:this.rotation,isSvg:this.#a,structTreeParentId:this._structTreeParentId};if(e)return i.bitmapUrl=this.#y(!0),i.accessibilityData=this.serializeAltText(!0),i;let{decorative:r,altText:s}=this.serializeAltText(!1);if(!r&&s&&(i.accessibilityData={type:"Figure",alt:s}),this.annotationElementId){let a=this.#C(i);if(a.isSame)return null;a.isSameAltText?delete i.accessibilityData:i.accessibilityData.structParent=this._initialData.structParent??-1}if(i.id=this.annotationElementId,t===null)return i;t.stamps||=new Map;let o=this.#a?(i.rect[2]-i.rect[0])*(i.rect[3]-i.rect[1]):null;if(!t.stamps.has(this.#t))t.stamps.set(this.#t,{area:o,serialized:i}),i.bitmap=this.#y(!1);else if(this.#a){let a=t.stamps.get(this.#t);o>a.area&&(a.area=o,a.serialized.bitmap.close(),a.serialized.bitmap=this.#y(!1))}return i}#C(e){let{rect:t,pageIndex:i,accessibilityData:{altText:r}}=this._initialData,s=e.rect.every((l,c)=>Math.abs(l-t[c])<1),o=e.pageIndex===i,a=(e.accessibilityData?.alt||"")===r;return{isSame:s&&o&&a,isSameAltText:a}}renderAnnotationElement(e){return e.updateEdited({rect:this.getRect(0,0)}),null}},fF=(()=>{class n{#e;#t=!1;#n=null;#i=null;#r=null;#s=new Map;#l=!1;#c=!1;#u=!1;#a=null;#d=null;#o;static _initialized=!1;static#h=new Map([fy,my,vy,uh].map(t=>[t._editorType,t]));constructor({uiManager:t,pageIndex:i,div:r,structTreeLayer:s,accessibilityManager:o,annotationLayer:a,drawLayer:l,textLayer:c,viewport:u,l10n:d}){let h=[...n.#h.values()];if(!n._initialized){n._initialized=!0;for(let f of h)f.initialize(d,t)}t.registerEditorTypes(h),this.#o=t,this.pageIndex=i,this.div=r,this.#e=o,this.#n=a,this.viewport=u,this.#a=c,this.drawLayer=l,this._structTree=s,this.#o.addLayer(this)}get isEmpty(){return this.#s.size===0}get isInvisible(){return this.isEmpty&&this.#o.getMode()===te.NONE}updateToolbar(t){this.#o.updateToolbar(t)}updateMode(t=this.#o.getMode()){switch(this.#m(),t){case te.NONE:this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case te.INK:this.addInkEditorIfNeeded(!1),this.disableTextSelection(),this.togglePointerEvents(!0),this.disableClick();break;case te.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:i}=this.div;for(let r of n.#h.values())i.toggle(`${r._type}Editing`,t===r._editorType);this.div.hidden=!1}hasTextLayer(t){return t===this.#a?.div}addInkEditorIfNeeded(t){if(this.#o.getMode()!==te.INK)return;if(!t){for(let r of this.#s.values())if(r.isEmpty()){r.setInBackground();return}}this.createAndAddNewEditor({offsetX:0,offsetY:0},!1).setInBackground()}setEditingState(t){this.#o.setEditingState(t)}addCommands(t){this.#o.addCommands(t)}toggleDrawing(t=!1){this.div.classList.toggle("drawing",!t)}togglePointerEvents(t=!1){this.div.classList.toggle("disabled",!t)}toggleAnnotationLayerPointerEvents(t=!1){this.#n?.div.classList.toggle("disabled",!t)}enable(){return A(this,null,function*(){this.div.tabIndex=0,this.togglePointerEvents(!0);let t=new Set;for(let r of this.#s.values())r.enableEditing(),r.show(!0),r.annotationElementId&&(this.#o.removeChangedExistingAnnotation(r),t.add(r.annotationElementId));if(!this.#n)return;let i=this.#n.getEditableAnnotations();for(let r of i){if(r.hide(),this.#o.isDeletedAnnotationElement(r.data.id)||t.has(r.data.id))continue;let s=yield this.deserialize(r);s&&(this.addOrRebuild(s),s.enableEditing())}})}disable(){this.#u=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1);let t=new Map,i=new Map;for(let s of this.#s.values())if(s.disableEditing(),!!s.annotationElementId){if(s.serialize()!==null){t.set(s.annotationElementId,s);continue}else i.set(s.annotationElementId,s);this.getEditableAnnotation(s.annotationElementId)?.show(),s.remove()}if(this.#n){let s=this.#n.getEditableAnnotations();for(let o of s){let{id:a}=o.data;if(this.#o.isDeletedAnnotationElement(a))continue;let l=i.get(a);if(l){l.resetAnnotationElement(o),l.show(!1),o.show();continue}l=t.get(a),l&&(this.#o.addChangedExistingAnnotation(l),l.renderAnnotationElement(o)&&l.show(!1)),o.show()}}this.#m(),this.isEmpty&&(this.div.hidden=!0);let{classList:r}=this.div;for(let s of n.#h.values())r.remove(`${s._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),this.#u=!1}getEditableAnnotation(t){return this.#n?.getEditableAnnotation(t)||null}setActiveEditor(t){this.#o.getActive()!==t&&this.#o.setActiveEditor(t)}enableTextSelection(){if(this.div.tabIndex=-1,this.#a?.div&&!this.#d){this.#d=new AbortController;let t=this.#o.combinedSignal(this.#d);this.#a.div.addEventListener("pointerdown",this.#p.bind(this),{signal:t}),this.#a.div.classList.add("highlighting")}}disableTextSelection(){this.div.tabIndex=0,this.#a?.div&&this.#d&&(this.#d.abort(),this.#d=null,this.#a.div.classList.remove("highlighting"))}#p(t){this.#o.unselectAll();let{target:i}=t;if(i===this.#a.div||(i.getAttribute("role")==="img"||i.classList.contains("endOfContent"))&&this.#a.div.contains(i)){let{isMac:r}=pt.platform;if(t.button!==0||t.ctrlKey&&r)return;this.#o.showAllEditors("highlight",!0,!0),this.#a.div.classList.add("free"),this.toggleDrawing(),uh.startHighlighting(this,this.#o.direction==="ltr",{target:this.#a.div,x:t.x,y:t.y}),this.#a.div.addEventListener("pointerup",()=>{this.#a.div.classList.remove("free"),this.toggleDrawing(!0)},{once:!0,signal:this.#o._signal}),t.preventDefault()}}enableClick(){if(this.#i)return;this.#i=new AbortController;let t=this.#o.combinedSignal(this.#i);this.div.addEventListener("pointerdown",this.pointerdown.bind(this),{signal:t}),this.div.addEventListener("pointerup",this.pointerup.bind(this),{signal:t})}disableClick(){this.#i?.abort(),this.#i=null}attach(t){this.#s.set(t.id,t);let{annotationElementId:i}=t;i&&this.#o.isDeletedAnnotationElement(i)&&this.#o.removeDeletedAnnotationElement(t)}detach(t){this.#s.delete(t.id),this.#e?.removePointerInTextLayer(t.contentDiv),!this.#u&&t.annotationElementId&&this.#o.addDeletedAnnotationElement(t)}remove(t){this.detach(t),this.#o.removeEditor(t),t.div.remove(),t.isAttachedToDOM=!1,this.#c||this.addInkEditorIfNeeded(!1)}changeParent(t){t.parent!==this&&(t.parent&&t.annotationElementId&&(this.#o.addDeletedAnnotationElement(t.annotationElementId),_e.deleteAnnotationElement(t),t.annotationElementId=null),this.attach(t),t.parent?.detach(t),t.setParent(this),t.div&&t.isAttachedToDOM&&(t.div.remove(),this.div.append(t.div)))}add(t){if(!(t.parent===this&&t.isAttachedToDOM)){if(this.changeParent(t),this.#o.addEditor(t),this.attach(t),!t.isAttachedToDOM){let i=t.render();this.div.append(i),t.isAttachedToDOM=!0}t.fixAndSetPosition(),t.onceAdded(),this.#o.addToAnnotationStorage(t),t._reportTelemetry(t.telemetryInitialData)}}moveEditorInDOM(t){if(!t.isAttachedToDOM)return;let{activeElement:i}=document;t.div.contains(i)&&!this.#r&&(t._focusEventsAllowed=!1,this.#r=setTimeout(()=>{this.#r=null,t.div.contains(document.activeElement)?t._focusEventsAllowed=!0:(t.div.addEventListener("focusin",()=>{t._focusEventsAllowed=!0},{once:!0,signal:this.#o._signal}),i.focus())},0)),t._structTreeParentId=this.#e?.moveElementInDOM(this.div,t.div,t.contentDiv,!0)}addOrRebuild(t){t.needsToBeRebuilt()?(t.parent||=this,t.rebuild(),t.show()):this.add(t)}addUndoableEditor(t){let i=()=>t._uiManager.rebuild(t),r=()=>{t.remove()};this.addCommands({cmd:i,undo:r,mustExec:!1})}getNextId(){return this.#o.getId()}get#f(){return n.#h.get(this.#o.getMode())}combinedSignal(t){return this.#o.combinedSignal(t)}#g(t){let i=this.#f;return i?new i.prototype.constructor(t):null}canCreateNewEmptyEditor(){return this.#f?.canCreateNewEmptyEditor()}pasteEditor(t,i){this.#o.updateToolbar(t),this.#o.updateMode(t);let{offsetX:r,offsetY:s}=this.#v(),o=this.getNextId(),a=this.#g(x({parent:this,id:o,x:r,y:s,uiManager:this.#o,isCentered:!0},i));a&&this.add(a)}deserialize(t){return A(this,null,function*(){return(yield n.#h.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#o))||null})}createAndAddNewEditor(t,i,r={}){let s=this.getNextId(),o=this.#g(x({parent:this,id:s,x:t.offsetX,y:t.offsetY,uiManager:this.#o,isCentered:i},r));return o&&this.add(o),o}#v(){let{x:t,y:i,width:r,height:s}=this.div.getBoundingClientRect(),o=Math.max(0,t),a=Math.max(0,i),l=Math.min(window.innerWidth,t+r),c=Math.min(window.innerHeight,i+s),u=(o+l)/2-t,d=(a+c)/2-i,[h,f]=this.viewport.rotation%180===0?[u,d]:[d,u];return{offsetX:h,offsetY:f}}addNewEditor(){this.createAndAddNewEditor(this.#v(),!0)}setSelected(t){this.#o.setSelected(t)}toggleSelected(t){this.#o.toggleSelected(t)}unselect(t){this.#o.unselect(t)}pointerup(t){let{isMac:i}=pt.platform;if(!(t.button!==0||t.ctrlKey&&i)&&t.target===this.div&&this.#l){if(this.#l=!1,!this.#t){this.#t=!0;return}if(this.#o.getMode()===te.STAMP){this.#o.unselectAll();return}this.createAndAddNewEditor(t,!1)}}pointerdown(t){if(this.#o.getMode()===te.HIGHLIGHT&&this.enableTextSelection(),this.#l){this.#l=!1;return}let{isMac:i}=pt.platform;if(t.button!==0||t.ctrlKey&&i||t.target!==this.div)return;this.#l=!0;let r=this.#o.getActive();this.#t=!r||r.isEmpty()}findNewParent(t,i,r){let s=this.#o.findParent(i,r);return s===null||s===this?!1:(s.changeParent(t),!0)}destroy(){this.#o.getActive()?.parent===this&&(this.#o.commitOrRemove(),this.#o.setActiveEditor(null)),this.#r&&(clearTimeout(this.#r),this.#r=null);for(let t of this.#s.values())this.#e?.removePointerInTextLayer(t.contentDiv),t.setParent(null),t.isAttachedToDOM=!1,t.div.remove();this.div=null,this.#s.clear(),this.#o.removeLayer(this)}#m(){this.#c=!0;for(let t of this.#s.values())t.isEmpty()&&t.remove();this.#c=!1}render({viewport:t}){this.viewport=t,Lr(this.div,t);for(let i of this.#o.getEditors(this.pageIndex))this.add(i),i.rebuild();this.updateMode()}update({viewport:t}){this.#o.commitOrRemove(),this.#m();let i=this.viewport.rotation,r=t.rotation;if(this.viewport=t,Lr(this.div,{rotation:r}),i!==r)for(let s of this.#s.values())s.rotate(r);this.addInkEditorIfNeeded(!1)}get pageDimensions(){let{pageWidth:t,pageHeight:i}=this.viewport.rawDims;return[t,i]}get scale(){return this.#o.viewParameters.realScale}}return n})(),yy=class n{#e=null;#t=0;#n=new Map;#i=new Map;constructor({pageIndex:e}){this.pageIndex=e}setParent(e){if(!this.#e){this.#e=e;return}if(this.#e!==e){if(this.#n.size>0)for(let t of this.#n.values())t.remove(),e.append(t);this.#e=e}}static get _svgFactory(){return de(this,"_svgFactory",new nl)}static#r(e,{x:t=0,y:i=0,width:r=1,height:s=1}={}){let{style:o}=e;o.top=`${100*i}%`,o.left=`${100*t}%`,o.width=`${100*r}%`,o.height=`${100*s}%`}#s(e){let t=n._svgFactory.create(1,1,!0);return this.#e.append(t),t.setAttribute("aria-hidden",!0),n.#r(t,e),t}#l(e,t){let i=n._svgFactory.createElement("clipPath");e.append(i);let r=`clip_${t}`;i.setAttribute("id",r),i.setAttribute("clipPathUnits","objectBoundingBox");let s=n._svgFactory.createElement("use");return i.append(s),s.setAttribute("href",`#${t}`),s.classList.add("clip"),r}draw(e,t,i,r=!1){let s=this.#t++,o=this.#s(e.box);o.classList.add(...e.classNamesForDrawing);let a=n._svgFactory.createElement("defs");o.append(a);let l=n._svgFactory.createElement("path");a.append(l);let c=`path_p${this.pageIndex}_${s}`;l.setAttribute("id",c),l.setAttribute("d",e.toSVGPath()),r&&this.#i.set(s,l);let u=this.#l(a,c),d=n._svgFactory.createElement("use");return o.append(d),o.setAttribute("fill",t),o.setAttribute("fill-opacity",i),d.setAttribute("href",`#${c}`),this.#n.set(s,o),{id:s,clipPathId:`url(#${u})`}}drawOutline(e){let t=this.#t++,i=this.#s(e.box);i.classList.add(...e.classNamesForOutlining);let r=n._svgFactory.createElement("defs");i.append(r);let s=n._svgFactory.createElement("path");r.append(s);let o=`path_p${this.pageIndex}_${t}`;s.setAttribute("id",o),s.setAttribute("d",e.toSVGPath()),s.setAttribute("vector-effect","non-scaling-stroke");let a;if(e.mustRemoveSelfIntersections){let u=n._svgFactory.createElement("mask");r.append(u),a=`mask_p${this.pageIndex}_${t}`,u.setAttribute("id",a),u.setAttribute("maskUnits","objectBoundingBox");let d=n._svgFactory.createElement("rect");u.append(d),d.setAttribute("width","1"),d.setAttribute("height","1"),d.setAttribute("fill","white");let h=n._svgFactory.createElement("use");u.append(h),h.setAttribute("href",`#${o}`),h.setAttribute("stroke","none"),h.setAttribute("fill","black"),h.setAttribute("fill-rule","nonzero"),h.classList.add("mask")}let l=n._svgFactory.createElement("use");i.append(l),l.setAttribute("href",`#${o}`),a&&l.setAttribute("mask",`url(#${a})`);let c=l.cloneNode();return i.append(c),l.classList.add("mainOutline"),c.classList.add("secondaryOutline"),this.#n.set(t,i),t}finalizeLine(e,t){let i=this.#i.get(e);this.#i.delete(e),this.updateBox(e,t.box),i.setAttribute("d",t.toSVGPath())}updateLine(e,t){this.#n.get(e).firstChild.firstChild.setAttribute("d",t.toSVGPath())}updatePath(e,t){this.#i.get(e).setAttribute("d",t.toSVGPath())}updateBox(e,t){n.#r(this.#n.get(e),t)}show(e,t){this.#n.get(e).classList.toggle("hidden",!t)}rotate(e,t){this.#n.get(e).setAttribute("data-main-rotation",t)}changeColor(e,t){this.#n.get(e).setAttribute("fill",t)}changeOpacity(e,t){this.#n.get(e).setAttribute("fill-opacity",t)}addClass(e,t){this.#n.get(e).classList.add(t)}removeClass(e,t){this.#n.get(e).classList.remove(t)}getSVGRoot(e){return this.#n.get(e)}remove(e){this.#i.delete(e),this.#e!==null&&(this.#n.get(e).remove(),this.#n.delete(e))}destroy(){this.#e=null;for(let e of this.#n.values())e.remove();this.#n.clear(),this.#i.clear()}};var pF=X.AbortException,gF=X.AnnotationEditorLayer,mF=X.AnnotationEditorParamsType,Sy=X.AnnotationEditorType,vF=X.AnnotationEditorUIManager,yF=X.AnnotationLayer,bF=X.AnnotationMode,wF=X.ColorPicker,_F=X.DOMSVGFactory,EF=X.DrawLayer,CF=X.FeatureTest,xy=X.GlobalWorkerOptions,AF=X.ImageKind,DF=X.InvalidPDFException,SF=X.MissingPDFException,xF=X.OPS,IF=X.OutputScale,TF=X.PDFDataRangeTransport,MF=X.PDFDateString,RF=X.PDFWorker,PF=X.PasswordResponses,NF=X.PermissionFlag,kF=X.PixelsPerInch,OF=X.RenderingCancelledException,LF=X.TextLayer,FF=X.UnexpectedResponseException,VF=X.Util,Iy=X.VerbosityLevel,jF=X.XfaLayer,BF=X.build,UF=X.createValidAbsoluteUrl,HF=X.fetchData,Ty=X.getDocument,$F=X.getFilenameFromUrl,zF=X.getPdfFilenameFromUrl,WF=X.getXfaPageViewport,GF=X.isDataScheme,qF=X.isPdfFile,YF=X.noContextMenu,XF=X.normalizeUnicode,KF=X.setLayerDimensions,ZF=X.shadow,al=X.version;var vb={};Sb(vb,{AnnotationLayerBuilder:()=>Vj,DownloadManager:()=>jj,EventBus:()=>Bj,FindState:()=>Uj,GenericL10n:()=>hb,LinkTarget:()=>Hr,PDFFindController:()=>fb,PDFHistory:()=>Hj,PDFLinkService:()=>pb,PDFPageView:()=>$j,PDFScriptingManager:()=>zj,PDFSinglePageViewer:()=>gb,PDFViewer:()=>mb,ProgressBar:()=>Wj,RenderingStates:()=>Gj,ScrollMode:()=>qj,SimpleLinkService:()=>Yj,SpreadMode:()=>Xj,StructTreeLayerBuilder:()=>Kj,TextLayerBuilder:()=>Zj,XfaLayerBuilder:()=>Qj,parseQueryString:()=>Jj});var cl={};cl.d=(n,e)=>{for(var t in e)cl.o(e,t)&&!cl.o(n,t)&&Object.defineProperty(n,t,{enumerable:!0,get:e[t]})};cl.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var Fe=globalThis.pdfjsViewer={};cl.d(Fe,{AnnotationLayerBuilder:()=>xh,DownloadManager:()=>Hy,EventBus:()=>Ih,FindState:()=>Yi,GenericL10n:()=>lo,LinkTarget:()=>jr,PDFFindController:()=>By,PDFHistory:()=>Jy,PDFLinkService:()=>Dh,PDFPageView:()=>kh,PDFScriptingManager:()=>lb,PDFSinglePageViewer:()=>db,PDFViewer:()=>Oh,ProgressBar:()=>jy,RenderingStates:()=>Be,ScrollMode:()=>pe,SimpleLinkService:()=>hl,SpreadMode:()=>Ct,StructTreeLayerBuilder:()=>Rh,TextLayerBuilder:()=>Ph,XfaLayerBuilder:()=>Nh,parseQueryString:()=>Lh});var QF="auto",fS=1,kD=1.1,JF=.1,eV=10,My=0,tV=1.25,OD=40,LD=5,Be={INITIAL:0,RUNNING:1,PAUSED:2,FINISHED:3},so={UNKNOWN:0,NORMAL:1,CHANGING:2,FULLSCREEN:3};var $n={DISABLE:0,ENABLE:1,ENABLE_PERMISSIONS:2},pe={UNKNOWN:-1,VERTICAL:0,HORIZONTAL:1,WRAPPED:2,PAGE:3},Ct={UNKNOWN:-1,NONE:0,ODD:1,EVEN:2};function pS(n,e,t=!1){let i=n.offsetParent;if(!i){console.error("offsetParent is not set -- cannot scroll");return}let r=n.offsetTop+n.clientTop,s=n.offsetLeft+n.clientLeft;for(;i.clientHeight===i.scrollHeight&&i.clientWidth===i.scrollWidth||t&&(i.classList.contains("markedContent")||getComputedStyle(i).overflow==="hidden");)if(r+=i.offsetTop,s+=i.offsetLeft,i=i.offsetParent,!i)return;e&&(e.top!==void 0&&(r+=e.top),e.left!==void 0&&(s+=e.left,i.scrollLeft=s)),i.scrollTop=r}function nV(n,e,t=void 0){let i=function(o){s||(s=window.requestAnimationFrame(function(){s=null;let l=n.scrollLeft,c=r.lastX;l!==c&&(r.right=l>c),r.lastX=l;let u=n.scrollTop,d=r.lastY;u!==d&&(r.down=u>d),r.lastY=u,e(r)}))},r={right:!0,down:!0,lastX:n.scrollLeft,lastY:n.scrollTop,_eventHandler:i},s=null;return n.addEventListener("scroll",i,{useCapture:!0,signal:t}),t?.addEventListener("abort",()=>window.cancelAnimationFrame(s),{once:!0}),r}function Lh(n){let e=new Map;for(let[t,i]of new URLSearchParams(n))e.set(t.toLowerCase(),i);return e}var FD=/[\x00-\x1F]/g;function ul(n,e=!1){return FD.test(n)?e?n.replaceAll(FD,t=>t==="\0"?"":" "):n.replaceAll("\0",""):n}function dl(n,e,t=0){let i=t,r=n.length-1;if(r<0||!e(n[r]))return n.length;if(e(n[i]))return i;for(;i>1,o=n[s];e(o)?r=s:i=s+1}return i}function VD(n){if(Math.floor(n)===n)return[n,1];let e=1/n,t=8;if(e>t)return[1,t];if(Math.floor(e)===e)return[1,e];let i=n>1?e:n,r=0,s=1,o=1,a=1;for(;;){let c=r+o,u=s+a;if(u>t)break;i<=c/u?(o=c,a=u):(r=c,s=u)}let l;return i-r/s=t&&(i=e[n-1].div,r=i.offsetTop+i.clientTop);for(let s=n-2;s>=0&&(i=e[s].div,!(i.offsetTop+i.clientTop+i.clientHeight<=r));--s)n=s;return n}function rV({scrollEl:n,views:e,sortByVisibility:t=!1,horizontal:i=!1,rtl:r=!1}){let s=n.scrollTop,o=s+n.clientHeight,a=n.scrollLeft,l=a+n.clientWidth;function c(y){let b=y.div;return b.offsetTop+b.clientTop+b.clientHeight>s}function u(y){let b=y.div,w=b.offsetLeft+b.clientLeft,E=w+b.clientWidth;return r?wa}let d=[],h=new Set,f=e.length,p=dl(e,i?u:c);p>0&&p=o&&(g=C);else if((i?E:S)>g)break;if(C<=s||S>=o||_<=a||E>=l)continue;let R=Math.max(0,s-S)+Math.max(0,C-o),ge=Math.max(0,a-E)+Math.max(0,_-l),he=(M-R)/M,le=(I-ge)/I,Ee=he*le*100|0;d.push({id:b.id,x:E,y:S,view:b,percent:Ee,widthPercent:le*100|0}),h.add(b.id)}let v=d[0],m=d.at(-1);return t&&d.sort(function(y,b){let w=y.percent-b.percent;return Math.abs(w)>.001?-w:y.id-b.id}),{first:v,last:m,views:d,ids:h}}function gS(n){return Number.isInteger(n)&&n%90===0}function sV(n){return Number.isInteger(n)&&Object.values(pe).includes(n)&&n!==pe.UNKNOWN}function oV(n){return Number.isInteger(n)&&Object.values(Ct).includes(n)&&n!==Ct.UNKNOWN}function jD(n){return n.width<=n.height}var Z5=new Promise(function(n){window.requestAnimationFrame(n)}),aV=document.documentElement.style;function lV(n,e,t){return Math.min(Math.max(n,e),t)}var jy=class{#e=null;#t=null;#n=0;#i=null;#r=!0;constructor(e){this.#e=e.classList,this.#i=e.style}get percent(){return this.#n}set percent(e){if(this.#n=lV(e,0,100),isNaN(e)){this.#e.add("indeterminate");return}this.#e.remove("indeterminate"),this.#i.setProperty("--progressBar-percent",`${this.#n}%`)}setWidth(e){if(!e)return;let i=e.parentNode.offsetWidth-e.offsetWidth;i>0&&this.#i.setProperty("--progressBar-end-offset",`${i}px`)}setDisableAutoFetch(e=5e3){this.#n===100||isNaN(this.#n)||(this.#t&&clearTimeout(this.#t),this.show(),this.#t=setTimeout(()=>{this.#t=null,this.hide()},e))}hide(){this.#r&&(this.#r=!1,this.#e.add("hidden"))}show(){this.#r||(this.#r=!0,this.#e.remove("hidden"))}};function cV(n){let e=pe.VERTICAL,t=Ct.NONE;switch(n){case"SinglePage":e=pe.PAGE;break;case"OneColumn":break;case"TwoPageLeft":e=pe.PAGE;case"TwoColumnLeft":t=Ct.ODD;break;case"TwoPageRight":e=pe.PAGE;case"TwoColumnRight":t=Ct.EVEN;break}return{scrollMode:e,spreadMode:t}}var bh=function(){let n=document.createElement("div");return n.style.width="round(down, calc(1.6666666666666665 * 792px), 1px)",n.style.width==="calc(1320px)"?Math.fround:e=>e}(),Dn={SPACE:0,ALPHA_LETTER:1,PUNCT:2,HAN_LETTER:3,KATAKANA_LETTER:4,HIRAGANA_LETTER:5,HALFWIDTH_KATAKANA_LETTER:6,THAI_LETTER:7};function uV(n){return n<11904}function dV(n){return(n&65408)===0}function hV(n){return n>=97&&n<=122||n>=65&&n<=90}function fV(n){return n>=48&&n<=57}function pV(n){return n===32||n===9||n===13||n===10}function gV(n){return n>=13312&&n<=40959||n>=63744&&n<=64255}function mV(n){return n>=12448&&n<=12543}function vV(n){return n>=12352&&n<=12447}function yV(n){return n>=65376&&n<=65439}function bV(n){return(n&65408)===3584}function wh(n){return uV(n)?dV(n)?pV(n)?Dn.SPACE:hV(n)||fV(n)||n===95?Dn.ALPHA_LETTER:Dn.PUNCT:bV(n)?Dn.THAI_LETTER:n===160?Dn.SPACE:Dn.ALPHA_LETTER:gV(n)?Dn.HAN_LETTER:mV(n)?Dn.KATAKANA_LETTER:vV(n)?Dn.HIRAGANA_LETTER:yV(n)?Dn.HALFWIDTH_KATAKANA_LETTER:Dn.ALPHA_LETTER}var BD;function wV(){return BD||="\xA0\xA8\xAA\xAF\xB2-\xB5\xB8-\xBA\xBC-\xBE\u0132-\u0133\u013F-\u0140\u0149\u017F\u01C4-\u01CC\u01F1-\u01F3\u02B0-\u02B8\u02D8-\u02DD\u02E0-\u02E4\u0374\u037A\u037E\u0384-\u0385\u0387\u03D0-\u03D6\u03F0-\u03F2\u03F4-\u03F5\u03F9\u0587\u0675-\u0678\u0958-\u095F\u09DC-\u09DD\u09DF\u0A33\u0A36\u0A59-\u0A5B\u0A5E\u0B5C-\u0B5D\u0E33\u0EB3\u0EDC-\u0EDD\u0F0C\u0F43\u0F4D\u0F52\u0F57\u0F5C\u0F69\u10FC\u1D2C-\u1D2E\u1D30-\u1D3A\u1D3C-\u1D4D\u1D4F-\u1D6A\u1D78\u1D9B-\u1DBF\u1E9A-\u1E9B\u1F71\u1F73\u1F75\u1F77\u1F79\u1F7B\u1F7D\u1FBB\u1FBD-\u1FC1\u1FC9\u1FCB\u1FCD-\u1FCF\u1FD3\u1FDB\u1FDD-\u1FDF\u1FE3\u1FEB\u1FED-\u1FEF\u1FF9\u1FFB\u1FFD-\u1FFE\u2000-\u200A\u2011\u2017\u2024-\u2026\u202F\u2033-\u2034\u2036-\u2037\u203C\u203E\u2047-\u2049\u2057\u205F\u2070-\u2071\u2074-\u208E\u2090-\u209C\u20A8\u2100-\u2103\u2105-\u2107\u2109-\u2113\u2115-\u2116\u2119-\u211D\u2120-\u2122\u2124\u2126\u2128\u212A-\u212D\u212F-\u2131\u2133-\u2139\u213B-\u2140\u2145-\u2149\u2150-\u217F\u2189\u222C-\u222D\u222F-\u2230\u2329-\u232A\u2460-\u24EA\u2A0C\u2A74-\u2A76\u2ADC\u2C7C-\u2C7D\u2D6F\u2E9F\u2EF3\u2F00-\u2FD5\u3000\u3036\u3038-\u303A\u309B-\u309C\u309F\u30FF\u3131-\u318E\u3192-\u319F\u3200-\u321E\u3220-\u3247\u3250-\u327E\u3280-\u33FF\uA69C-\uA69D\uA770\uA7F2-\uA7F4\uA7F8-\uA7F9\uAB5C-\uAB5F\uAB69\uF900-\uFA0D\uFA10\uFA12\uFA15-\uFA1E\uFA20\uFA22\uFA25-\uFA26\uFA2A-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFC\uFE10-\uFE19\uFE30-\uFE44\uFE47-\uFE52\uFE54-\uFE66\uFE68-\uFE6B\uFE70-\uFE72\uFE74\uFE76-\uFEFC\uFF01-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\uFFE0-\uFFE6",BD}var Yi={FOUND:0,NOT_FOUND:1,WRAPPED:2,PENDING:3},_V=250,EV=-50,CV=-400,UD={"\u2010":"-","\u2018":"'","\u2019":"'","\u201A":"'","\u201B":"'","\u201C":'"',"\u201D":'"',"\u201E":'"',"\u201F":'"',"\xBC":"1/4","\xBD":"1/2","\xBE":"3/4"},HD=new Set([12441,12442,2381,2509,2637,2765,2893,3021,3149,3277,3387,3388,3405,3530,3642,3770,3972,4153,4154,5908,5940,6098,6752,6980,7082,7083,7154,7155,11647,43014,43052,43204,43347,43456,43766,44013,3158,3953,3954,3962,3963,3964,3965,3968,3956]),$D,AV=new RegExp("\\p{M}+","gu"),DV=new RegExp("([.*+?^${}()|[\\]\\\\])|(\\p{P})|(\\s+)|(\\p{M})|(\\p{L})","gu"),SV=new RegExp("([^\\p{M}])\\p{M}*$","u"),xV=new RegExp("^\\p{M}*([^\\p{M}])","u"),IV=/[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g,zD=new Map,TV="[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]",WD=new Map,Ry=null,Py=null;function Ny(n){let e=[],t;for(;(t=IV.exec(n))!==null;){let{index:f}=t;for(let p of t[0]){let g=zD.get(p);g||(g=p.normalize("NFD").length,zD.set(p,g)),e.push([g,f++])}}let i;if(e.length===0&&Ry)i=Ry;else if(e.length>0&&Py)i=Py;else{let f=Object.keys(UD).join(""),p=wV(),y=`([${f}])|([${p}])|((?:\u3099|\u309A)\\n)|(\\p{M}+(?:-\\n)?)|(\\p{Ll}-\\n\\p{Lu})|(\\S-\\n)|((?:\\p{Ideographic}|[\u3040-\u30FF])\\n)|(\\n)`;e.length===0?i=Ry=new RegExp(y+"|(\\u0000)","gum"):i=Py=new RegExp(y+`|(${TV})`,"gum")}let r=[];for(;(t=AV.exec(n))!==null;)r.push([t[0].length,t.index]);let s=n.normalize("NFD"),o=[[0,0]],a=0,l=0,c=0,u=0,d=0,h=!1;return s=s.replace(i,(f,p,g,v,m,y,b,w,E,S,I)=>{if(I-=u,p){let M=UD[p],_=M.length;for(let C=1;C<_;C++)o.push([I-c+C,c-C]);return c-=_-1,M}if(g){let M=WD.get(g);M||(M=g.normalize("NFKC"),WD.set(g,M));let _=M.length;for(let C=1;C<_;C++)o.push([I-c+C,c-C]);return c-=_-1,M}if(v)return h=!0,I+d===r[a]?.[1]?++a:(o.push([I-1-c+1,c-1]),c-=1,u+=1),o.push([I-c+1,c]),u+=1,d+=1,v.charAt(0);if(m){let M=m.endsWith(` `),_=M?m.length-2:m.length;h=!0;let C=_;I+d===r[a]?.[1]&&(C-=r[a][0],++a);for(let R=1;R<=C;R++)o.push([I-1-c+R,c-R]);return c-=C,u+=C,M?(I+=_-1,o.push([I-c+1,1+c]),c+=1,u+=1,d+=1,m.slice(0,_)):m}if(y)return o.push([I-c+3,1+c]),c+=1,u+=1,d+=1,y.replace(` `,"");if(b){let M=b.length-2;return o.push([I-c+M,1+c]),c+=1,u+=1,d+=1,b.slice(0,-2)}if(w){let M=w.length-1;return o.push([I-c+M,c]),u+=1,d+=1,w.slice(0,-1)}if(E)return o.push([I-c+1,c-1]),c-=1,u+=1,d+=1," ";if(I+d===e[l]?.[1]){let M=e[l][0]-1;++l;for(let _=1;_<=M;_++)o.push([I-(c-_),c-_]);c-=M,u+=M}return S}),o.push([s.length,c]),[s,o,h]}function MV(n,e,t){if(!n)return[e,t];let i=e,r=e+t-1,s=dl(n,u=>u[0]>=i);n[s][0]>i&&--s;let o=dl(n,u=>u[0]>=r,s);n[o][0]>r&&--o;let a=i+n[s][1],c=r+n[o][1]+1-a;return[a,c]}var By=class{#e=null;#t=!0;#n=0;constructor({linkService:e,eventBus:t,updateMatchesCountOnProgress:i=!0}){this._linkService=e,this._eventBus=t,this.#t=i,this.onIsPageVisible=null,this.#r(),t._on("find",this.#i.bind(this)),t._on("findbarclose",this.#y.bind(this))}get highlightMatches(){return this._highlightMatches}get pageMatches(){return this._pageMatches}get pageMatchesLength(){return this._pageMatchesLength}get selected(){return this._selected}get state(){return this.#e}setDocument(e){this._pdfDocument&&this.#r(),e&&(this._pdfDocument=e,this._firstPageCapability.resolve())}#i(e){if(!e)return;let t=this._pdfDocument,{type:i}=e;(this.#e===null||this.#l(e))&&(this._dirtyMatch=!0),this.#e=e,i!=="highlightallchange"&&this.#_(Yi.PENDING),this._firstPageCapability.promise.then(()=>{if(!this._pdfDocument||t&&this._pdfDocument!==t)return;this.#d();let r=!this._highlightMatches,s=!!this._findTimeout;this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),i?this._dirtyMatch?this.#p():i==="again"?(this.#p(),r&&this.#e.highlightAll&&this.#h()):i==="highlightallchange"?(s?this.#p():this._highlightMatches=!0,this.#h()):this.#p():this._findTimeout=setTimeout(()=>{this.#p(),this._findTimeout=null},_V)})}scrollMatchIntoView({element:e=null,selectedLeft:t=0,pageIndex:i=-1,matchIndex:r=-1}){if(!this._scrollMatches||!e)return;if(r===-1||r!==this._selected.matchIdx)return;if(i===-1||i!==this._selected.pageIdx)return;this._scrollMatches=!1;let s={top:EV,left:t+CV};pS(e,s,!0)}#r(){this._highlightMatches=!1,this._scrollMatches=!1,this._pdfDocument=null,this._pageMatches=[],this._pageMatchesLength=[],this.#n=0,this.#e=null,this._selected={pageIdx:-1,matchIdx:-1},this._offset={pageIdx:null,matchIdx:null,wrapped:!1},this._extractTextPromises=[],this._pageContents=[],this._pageDiffs=[],this._hasDiacritics=[],this._matchesCountTotal=0,this._pagesToSearch=null,this._pendingFindMatches=new Set,this._resumePageIdx=null,this._dirtyMatch=!1,clearTimeout(this._findTimeout),this._findTimeout=null,this._firstPageCapability=Promise.withResolvers()}get#s(){let{query:e}=this.#e;return typeof e=="string"?(e!==this._rawQuery&&(this._rawQuery=e,[this._normalizedQuery]=Ny(e)),this._normalizedQuery):(e||[]).filter(t=>!!t).map(t=>Ny(t)[0])}#l(e){let t=e.query,i=this.#e.query,r=typeof t;if(r!==typeof i)return!0;if(r==="string"){if(t!==i)return!0}else if(JSON.stringify(t)!==JSON.stringify(i))return!0;switch(e.type){case"again":let o=this._selected.pageIdx+1,a=this._linkService;return o>=1&&o<=a.pagesCount&&o!==a.page&&!(this.onIsPageVisible?.(o)??!0);case"highlightallchange":return!1}return!0}#c(e,t,i){let r=e.slice(0,t).match(SV);if(r){let s=e.charCodeAt(t),o=r[1].charCodeAt(0);if(wh(s)===wh(o))return!1}if(r=e.slice(t+i).match(xV),r){let s=e.charCodeAt(t+i-1),o=r[1].charCodeAt(0);if(wh(s)===wh(o))return!1}return!0}#u(e,t){let{matchDiacritics:i}=this.#e,r=!1;e=e.replaceAll(DV,(o,a,l,c,u,d)=>a?`[ ]*\\${a}[ ]*`:l?`[ ]*${l}[ ]*`:c?"[ ]+":i?u||d:u?HD.has(u.charCodeAt(0))?u:"":t?(r=!0,`${d}\\p{M}*`):d);let s="[ ]*";return e.endsWith(s)&&(e=e.slice(0,e.length-s.length)),i&&t&&($D||=String.fromCharCode(...HD),r=!0,e=`${e}(?=[${$D}]|[^\\p{M}]|$)`),[r,e]}#a(e){let t=this.#s;if(t.length===0)return;let i=this._pageContents[e],r=this.match(t,i,e),s=this._pageMatches[e]=[],o=this._pageMatchesLength[e]=[],a=this._pageDiffs[e];r?.forEach(({index:c,length:u})=>{let[d,h]=MV(a,c,u);h&&(s.push(d),o.push(h))}),this.#e.highlightAll&&this.#o(e),this._resumePageIdx===e&&(this._resumePageIdx=null,this.#g());let l=s.length;this._matchesCountTotal+=l,this.#t?l>0&&this.#C():++this.#n===this._linkService.pagesCount&&this.#C()}match(e,t,i){let r=this._hasDiacritics[i],s=!1;if(typeof e=="string"?[s,e]=this.#u(e,r):e=e.sort().reverse().map(d=>{let[h,f]=this.#u(d,r);return s||=h,`(${f})`}).join("|"),!e)return;let{caseSensitive:o,entireWord:a}=this.#e,l=`g${s?"u":""}${o?"":"i"}`;e=new RegExp(e,l);let c=[],u;for(;(u=e.exec(t))!==null;)a&&!this.#c(t,u.index,u[0].length)||c.push({index:u.index,length:u[0].length});return c}#d(){if(this._extractTextPromises.length>0)return;let e=Promise.resolve(),t={disableNormalization:!0};for(let i=0,r=this._linkService.pagesCount;ithis._pdfDocument.getPage(i+1).then(a=>a.getTextContent(t)).then(a=>{let l=[];for(let c of a.items)l.push(c.str),c.hasEOL&&l.push(` `);[this._pageContents[i],this._pageDiffs[i],this._hasDiacritics[i]]=Ny(l.join("")),o()},a=>{console.error(`Unable to get text content for page ${i+1}`,a),this._pageContents[i]="",this._pageDiffs[i]=null,this._hasDiacritics[i]=!1,o()}))}}#o(e){this._scrollMatches&&this._selected.pageIdx===e&&(this._linkService.page=e+1),this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:e})}#h(){this._eventBus.dispatch("updatetextlayermatches",{source:this,pageIndex:-1})}#p(){let e=this.#e.findPrevious,t=this._linkService.page-1,i=this._linkService.pagesCount;if(this._highlightMatches=!0,this._dirtyMatch){this._dirtyMatch=!1,this._selected.pageIdx=this._selected.matchIdx=-1,this._offset.pageIdx=t,this._offset.matchIdx=null,this._offset.wrapped=!1,this._resumePageIdx=null,this._pageMatches.length=0,this._pageMatchesLength.length=0,this.#n=0,this._matchesCountTotal=0,this.#h();for(let o=0;o{this._pendingFindMatches.delete(o),this.#a(o)}))}if(this.#s.length===0){this.#_(Yi.FOUND);return}if(this._resumePageIdx)return;let s=this._offset;if(this._pagesToSearch=i,s.matchIdx!==null){let o=this._pageMatches[s.pageIdx].length;if(!e&&s.matchIdx+10){s.matchIdx=e?s.matchIdx-1:s.matchIdx+1,this.#m(!0);return}this.#v(e)}this.#g()}#f(e){let t=this._offset,i=e.length,r=this.#e.findPrevious;return i?(t.matchIdx=r?i-1:0,this.#m(!0),!0):(this.#v(r),t.wrapped&&(t.matchIdx=null,this._pagesToSearch<0)?(this.#m(!1),!0):!1)}#g(){this._resumePageIdx!==null&&console.error("There can only be one pending page.");let e=null;do{let t=this._offset.pageIdx;if(e=this._pageMatches[t],!e){this._resumePageIdx=t;break}}while(!this.#f(e))}#v(e){let t=this._offset,i=this._linkService.pagesCount;t.pageIdx=e?t.pageIdx-1:t.pageIdx+1,t.matchIdx=null,this._pagesToSearch--,(t.pageIdx>=i||t.pageIdx<0)&&(t.pageIdx=e?i-1:0,t.wrapped=!0)}#m(e=!1){let t=Yi.NOT_FOUND,i=this._offset.wrapped;if(this._offset.wrapped=!1,e){let r=this._selected.pageIdx;this._selected.pageIdx=this._offset.pageIdx,this._selected.matchIdx=this._offset.matchIdx,t=i?Yi.WRAPPED:Yi.FOUND,r!==-1&&r!==this._selected.pageIdx&&this.#o(r)}this.#_(t,this.#e.findPrevious),this._selected.pageIdx!==-1&&(this._scrollMatches=!0,this.#o(this._selected.pageIdx))}#y(e){let t=this._pdfDocument;this._firstPageCapability.promise.then(()=>{!this._pdfDocument||t&&this._pdfDocument!==t||(this._findTimeout&&(clearTimeout(this._findTimeout),this._findTimeout=null),this._resumePageIdx&&(this._resumePageIdx=null,this._dirtyMatch=!0),this.#_(Yi.FOUND),this._highlightMatches=!1,this.#h())})}#w(){let{pageIdx:e,matchIdx:t}=this._selected,i=0,r=this._matchesCountTotal;if(t!==-1){for(let s=0;sr)&&(i=r=0),{current:i,total:r}}#C(){this._eventBus.dispatch("updatefindmatchescount",{source:this,matchesCount:this.#w()})}#_(e,t=!1){!this.#t&&(this.#n!==this._linkService.pagesCount||e===Yi.PENDING)||this._eventBus.dispatch("updatefindcontrolstate",{source:this,state:e,previous:t,entireWord:this.#e?.entireWord??null,matchesCount:this.#w(),rawQuery:this.#e?.query??null})}},RV="noopener noreferrer nofollow",jr={NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4},Dh=class n{externalLinkEnabled=!0;constructor({eventBus:e,externalLinkTarget:t=null,externalLinkRel:i=null,ignoreDestinationZoom:r=!1}={}){this.eventBus=e,this.externalLinkTarget=t,this.externalLinkRel=i,this._ignoreDestinationZoom=r,this.baseUrl=null,this.pdfDocument=null,this.pdfViewer=null,this.pdfHistory=null}setDocument(e,t=null){this.baseUrl=t,this.pdfDocument=e}setViewer(e){this.pdfViewer=e}setHistory(e){this.pdfHistory=e}get pagesCount(){return this.pdfDocument?this.pdfDocument.numPages:0}get page(){return this.pdfDocument?this.pdfViewer.currentPageNumber:1}set page(e){this.pdfDocument&&(this.pdfViewer.currentPageNumber=e)}get rotation(){return this.pdfDocument?this.pdfViewer.pagesRotation:0}set rotation(e){this.pdfDocument&&(this.pdfViewer.pagesRotation=e)}get isInPresentationMode(){return this.pdfDocument?this.pdfViewer.isInPresentationMode:!1}goToDestination(e){return A(this,null,function*(){if(!this.pdfDocument)return;let t,i,r;if(typeof e=="string"?(t=e,i=yield this.pdfDocument.getDestination(e)):(t=null,i=yield e),!Array.isArray(i)){console.error(`goToDestination: "${i}" is not a valid destination array, for dest="${e}".`);return}let[s]=i;if(s&&typeof s=="object"){if(r=this.pdfDocument.cachedPageNumber(s),!r)try{r=(yield this.pdfDocument.getPageIndex(s))+1}catch{console.error(`goToDestination: "${s}" is not a valid page reference, for dest="${e}".`);return}}else Number.isInteger(s)&&(r=s+1);if(!r||r<1||r>this.pagesCount){console.error(`goToDestination: "${r}" is not a valid page number, for dest="${e}".`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.push({namedDest:t,explicitDest:i,pageNumber:r})),this.pdfViewer.scrollPageIntoView({pageNumber:r,destArray:i,ignoreDestinationZoom:this._ignoreDestinationZoom})})}goToPage(e){if(!this.pdfDocument)return;let t=typeof e=="string"&&this.pdfViewer.pageLabelToPageNumber(e)||e|0;if(!(Number.isInteger(t)&&t>0&&t<=this.pagesCount)){console.error(`PDFLinkService.goToPage: "${e}" is not a valid page.`);return}this.pdfHistory&&(this.pdfHistory.pushCurrentPosition(),this.pdfHistory.pushPage(t)),this.pdfViewer.scrollPageIntoView({pageNumber:t})}addLinkAttributes(e,t,i=!1){if(!t||typeof t!="string")throw new Error('A valid "url" parameter must provided.');let r=i?jr.BLANK:this.externalLinkTarget,s=this.externalLinkRel;this.externalLinkEnabled?e.href=e.title=t:(e.href="",e.title=`Disabled: ${t}`,e.onclick=()=>!1);let o="";switch(r){case jr.NONE:break;case jr.SELF:o="_self";break;case jr.BLANK:o="_blank";break;case jr.PARENT:o="_parent";break;case jr.TOP:o="_top";break}e.target=o,e.rel=typeof s=="string"?s:RV}getDestinationHash(e){if(typeof e=="string"){if(e.length>0)return this.getAnchorUrl("#"+escape(e))}else if(Array.isArray(e)){let t=JSON.stringify(e);if(t.length>0)return this.getAnchorUrl("#"+escape(t))}return this.getAnchorUrl("")}getAnchorUrl(e){return this.baseUrl?this.baseUrl+e:e}setHash(e){if(!this.pdfDocument)return;let t,i;if(e.includes("=")){let r=Lh(e);if(r.has("search")){let s=r.get("search").replaceAll('"',""),o=r.get("phrase")==="true";this.eventBus.dispatch("findfromurlhash",{source:this,query:o?s:s.match(/\S+/g)})}if(r.has("page")&&(t=r.get("page")|0||1),r.has("zoom")){let s=r.get("zoom").split(","),o=s[0],a=parseFloat(o);o.includes("Fit")?o==="Fit"||o==="FitB"?i=[null,{name:o}]:o==="FitH"||o==="FitBH"||o==="FitV"||o==="FitBV"?i=[null,{name:o},s.length>1?s[1]|0:null]:o==="FitR"?s.length!==5?console.error('PDFLinkService.setHash: Not enough parameters for "FitR".'):i=[null,{name:o},s[1]|0,s[2]|0,s[3]|0,s[4]|0]:console.error(`PDFLinkService.setHash: "${o}" is not a valid zoom value.`):i=[null,{name:"XYZ"},s.length>1?s[1]|0:null,s.length>2?s[2]|0:null,a?a/100:o]}i?this.pdfViewer.scrollPageIntoView({pageNumber:t||this.page,destArray:i,allowNegativeOffset:!0}):t&&(this.page=t),r.has("pagemode")&&this.eventBus.dispatch("pagemode",{source:this,mode:r.get("pagemode")}),r.has("nameddest")&&this.goToDestination(r.get("nameddest"));return}i=unescape(e);try{i=JSON.parse(i),Array.isArray(i)||(i=i.toString())}catch{}if(typeof i=="string"||n.#e(i)){this.goToDestination(i);return}console.error(`PDFLinkService.setHash: "${unescape(e)}" is not a valid destination.`)}executeNamedAction(e){if(this.pdfDocument){switch(e){case"GoBack":this.pdfHistory?.back();break;case"GoForward":this.pdfHistory?.forward();break;case"NextPage":this.pdfViewer.nextPage();break;case"PrevPage":this.pdfViewer.previousPage();break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1;break;default:break}this.eventBus.dispatch("namedaction",{source:this,action:e})}}executeSetOCGState(e){return A(this,null,function*(){if(!this.pdfDocument)return;let t=this.pdfDocument,i=yield this.pdfViewer.optionalContentConfigPromise;t===this.pdfDocument&&(i.setOCGState(e),this.pdfViewer.optionalContentConfigPromise=Promise.resolve(i))})}static#e(e){if(!Array.isArray(e)||e.length<2)return!1;let[t,i,...r]=e;if(!(typeof t=="object"&&Number.isInteger(t?.num)&&Number.isInteger(t?.gen))&&!Number.isInteger(t)||!(typeof i=="object"&&typeof i?.name=="string"))return!1;let s=r.length,o=!0;switch(i.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return s===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(s!==4)return!1;o=!1;break;default:return!1}for(let a of r)if(!(typeof a=="number"||o&&a===null))return!1;return!0}},hl=class extends Dh{setDocument(e,t=null){}},{AbortException:PV,AnnotationEditorLayer:NV,AnnotationEditorParamsType:Q5,AnnotationEditorType:Jt,AnnotationEditorUIManager:kV,AnnotationLayer:OV,AnnotationMode:Ai,build:J5,ColorPicker:e6,createValidAbsoluteUrl:LV,DOMSVGFactory:t6,DrawLayer:FV,FeatureTest:n6,fetchData:GD,getDocument:i6,getFilenameFromUrl:r6,getPdfFilenameFromUrl:VV,getXfaPageViewport:s6,GlobalWorkerOptions:o6,ImageKind:a6,InvalidPDFException:l6,isDataScheme:c6,isPdfFile:jV,MissingPDFException:u6,noContextMenu:d6,normalizeUnicode:BV,OPS:h6,OutputScale:UV,PasswordResponses:f6,PDFDataRangeTransport:p6,PDFDateString:g6,PDFWorker:m6,PermissionFlag:_h,PixelsPerInch:Ci,RenderingCancelledException:Uy,setLayerDimensions:HV,shadow:Sh,TextLayer:$V,UnexpectedResponseException:v6,Util:y6,VerbosityLevel:b6,version:qD,XfaLayer:ky}=globalThis.pdfjsLib,xh=class{#e=null;#t=null;constructor({pdfPage:e,linkService:t,downloadManager:i,annotationStorage:r=null,imageResourcesPath:s="",renderForms:o=!0,enableScripting:a=!1,hasJSActionsPromise:l=null,fieldObjectsPromise:c=null,annotationCanvasMap:u=null,accessibilityManager:d=null,annotationEditorUIManager:h=null,onAppend:f=null}){this.pdfPage=e,this.linkService=t,this.downloadManager=i,this.imageResourcesPath=s,this.renderForms=o,this.annotationStorage=r,this.enableScripting=a,this._hasJSActionsPromise=l||Promise.resolve(!1),this._fieldObjectsPromise=c||Promise.resolve(null),this._annotationCanvasMap=u,this._accessibilityManager=d,this._annotationEditorUIManager=h,this.#e=f,this.annotationLayer=null,this.div=null,this._cancelled=!1,this._eventBus=t.eventBus}render(e,t,i="display"){return A(this,null,function*(){if(this.div){if(this._cancelled||!this.annotationLayer)return;this.annotationLayer.update({viewport:e.clone({dontFlip:!0})});return}let[r,s,o]=yield Promise.all([this.pdfPage.getAnnotations({intent:i}),this._hasJSActionsPromise,this._fieldObjectsPromise]);if(this._cancelled)return;let a=this.div=document.createElement("div");if(a.className="annotationLayer",this.#e?.(a),r.length===0){this.hide();return}this.annotationLayer=new OV({div:a,accessibilityManager:this._accessibilityManager,annotationCanvasMap:this._annotationCanvasMap,annotationEditorUIManager:this._annotationEditorUIManager,page:this.pdfPage,viewport:e.clone({dontFlip:!0}),structTreeLayer:t?.structTreeLayer||null}),yield this.annotationLayer.render({annotations:r,imageResourcesPath:this.imageResourcesPath,renderForms:this.renderForms,linkService:this.linkService,downloadManager:this.downloadManager,annotationStorage:this.annotationStorage,enableScripting:this.enableScripting,hasJSActions:s,fieldObjects:o}),this.linkService.isInPresentationMode&&this.#n(so.FULLSCREEN),this.#t||(this.#t=new AbortController,this._eventBus?._on("presentationmodechanged",l=>{this.#n(l.state)},{signal:this.#t.signal}))})}cancel(){this._cancelled=!0,this.#t?.abort(),this.#t=null}hide(){this.div&&(this.div.hidden=!0)}hasEditableAnnotations(){return!!this.annotationLayer?.hasEditableAnnotations()}#n(e){if(!this.div)return;let t=!1;switch(e){case so.FULLSCREEN:t=!0;break;case so.NORMAL:break;default:return}for(let i of this.div.childNodes)i.hasAttribute("data-internal-link")||(i.inert=t)}};function YD(n,e){let t=document.createElement("a");if(!t.click)throw new Error('DownloadManager: "a.click()" is not supported.');t.href=n,t.target="_parent","download"in t&&(t.download=e),(document.body||document.documentElement).append(t),t.click(),t.remove()}var Hy=class{#e=new WeakMap;downloadData(e,t,i){let r=URL.createObjectURL(new Blob([e],{type:i}));YD(r,t)}openOrDownloadData(e,t,i=null){let s=jV(t)?"application/pdf":"";return this.downloadData(e,t,s),!1}download(e,t,i){let r;if(e)r=URL.createObjectURL(new Blob([e],{type:"application/pdf"}));else{if(!LV(t,"http://example.com")){console.error(`download - not a valid URL: ${t}`);return}r=t+"#pdfjs.action=download"}YD(r,i)}},XD={EVENT:"event",TIMEOUT:"timeout"};function zV(i){return A(this,arguments,function*({target:n,name:e,delay:t=0}){if(typeof n!="object"||!(e&&typeof e=="string")||!(Number.isInteger(t)&&t>=0))throw new Error("waitOnEventOrTimeout - invalid parameters.");let{promise:r,resolve:s}=Promise.withResolvers(),o=new AbortController;function a(u){o.abort(),clearTimeout(c),s(u)}let l=n instanceof Ih?"_on":"addEventListener";n[l](e,a.bind(null,XD.EVENT),{signal:o.signal});let c=setTimeout(a.bind(null,XD.TIMEOUT),t);return r})}var Ih=class{#e=Object.create(null);on(e,t,i=null){this._on(e,t,{external:!0,once:i?.once,signal:i?.signal})}off(e,t,i=null){this._off(e,t)}dispatch(e,t){let i=this.#e[e];if(!i||i.length===0)return;let r;for(let{listener:s,external:o,once:a}of i.slice(0)){if(a&&this._off(e,s),o){(r||=[]).push(s);continue}s(t)}if(r){for(let s of r)s(t);r=null}}_on(e,t,i=null){let r=null;if(i?.signal instanceof AbortSignal){let{signal:o}=i;if(o.aborted){console.error("Cannot use an `aborted` signal.");return}let a=()=>this._off(e,t);r=()=>o.removeEventListener("abort",a),o.addEventListener("abort",a)}(this.#e[e]||=[]).push({listener:t,external:i?.external===!0,once:i?.once===!0,rmAbort:r})}_off(e,t,i=null){let r=this.#e[e];if(r)for(let s=0,o=r.length;s1;for(let r of e){if(typeof r=="string"){t.push(n.bundle._transform(r));continue}if(n.placeables++,n.placeables>KD)throw n.dirty.delete(e),new RangeError(`Too many placeables expanded: ${n.placeables}, max allowed is ${KD}`);i&&t.push(WV),t.push(fl(n,r).toString(n)),i&&t.push(GV)}return n.dirty.delete(e),t.join("")}function ao(n,e){return typeof e=="string"?n.bundle._transform(e):mS(n,e)}var zy=class{constructor(e,t,i){this.dirty=new WeakSet,this.params=null,this.placeables=0,this.bundle=e,this.errors=t,this.args=i}reportError(e){if(!this.errors||!(e instanceof Error))throw e;this.errors.push(e)}memoizeIntlObject(e,t){let i=this.bundle._intls.get(e);i||(i={},this.bundle._intls.set(e,i));let r=JSON.stringify(t);return i[r]||(i[r]=new e(this.bundle.locales,t)),i[r]}};function Th(n,e){let t=Object.create(null);for(let[i,r]of Object.entries(n))e.includes(i)&&(t[i]=r.valueOf());return t}var QD=["unitDisplay","currencyDisplay","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"];function JV(n,e){let t=n[0];if(t instanceof Ue)return new Ue(`NUMBER(${t.valueOf()})`);if(t instanceof Sn)return new Sn(t.valueOf(),x(x({},t.opts),Th(e,QD)));if(t instanceof Ur)return new Sn(t.valueOf(),x({},Th(e,QD)));throw new TypeError("Invalid argument to NUMBER")}var JD=["dateStyle","timeStyle","fractionalSecondDigits","dayPeriod","hour12","weekday","era","year","month","day","hour","minute","second","timeZoneName"];function ej(n,e){let t=n[0];if(t instanceof Ue)return new Ue(`DATETIME(${t.valueOf()})`);if(t instanceof Ur)return new Ur(t.valueOf(),x(x({},t.opts),Th(e,JD)));if(t instanceof Sn)return new Ur(t.valueOf(),x({},Th(e,JD)));throw new TypeError("Invalid argument to DATETIME")}var eS=new Map;function tj(n){let e=Array.isArray(n)?n.join(" "):n,t=eS.get(e);return t===void 0&&(t=new Map,eS.set(e,t)),t}var Wy=class{constructor(e,{functions:t,useIsolating:i=!0,transform:r=s=>s}={}){this._terms=new Map,this._messages=new Map,this.locales=Array.isArray(e)?e:[e],this._functions=x({NUMBER:JV,DATETIME:ej},t),this._useIsolating=i,this._transform=r,this._intls=tj(e)}hasMessage(e){return this._messages.has(e)}getMessage(e){return this._messages.get(e)}addResource(e,{allowOverrides:t=!1}={}){let i=[];for(let r=0;r\s*/y,pj=/\s*:\s*/y,gj=/\s*,?\s*/y,mj=/\s+/y,Gy=class{constructor(e){this.body=[],Oy.lastIndex=0;let t=0;for(;;){let _=Oy.exec(e);if(_===null)break;t=Oy.lastIndex;try{this.body.push(l(_[1]))}catch(C){if(C instanceof SyntaxError)continue;throw C}}function i(_){return _.lastIndex=t,_.test(e)}function r(_,C){if(e[t]===_)return t++,!0;if(C)throw new C(`Expected ${_}`);return!1}function s(_,C){if(i(_))return t=_.lastIndex,!0;if(C)throw new C(`Expected ${_.toString()}`);return!1}function o(_){_.lastIndex=t;let C=_.exec(e);if(C===null)throw new SyntaxError(`Expected ${_.toString()}`);return t=_.lastIndex,C}function a(_){return o(_)[1]}function l(_){let C=u(),R=c();if(C===null&&Object.keys(R).length===0)throw new SyntaxError("Expected message value or attributes");return{id:_,value:C,attributes:R}}function c(){let _=Object.create(null);for(;i(tS);){let C=a(tS),R=u();if(R===null)throw new SyntaxError("Expected attribute value");_[C]=R}return _}function u(){let _;if(i(Eh)&&(_=a(Eh)),e[t]==="{"||e[t]==="}")return d(_?[_]:[],1/0);let C=S();return C?_?d([_,C],C.length):(C.value=I(C.value,oj),d([C],C.length)):_?I(_,sS):null}function d(_=[],C){for(;;){if(i(Eh)){_.push(a(Eh));continue}if(e[t]==="{"){_.push(h());continue}if(e[t]==="}")throw new SyntaxError("Unbalanced closing brace");let le=S();if(le){_.push(le),C=Math.min(C,le.length);continue}break}let R=_.length-1,ge=_[R];typeof ge=="string"&&(_[R]=I(ge,sS));let he=[];for(let le of _)le instanceof Mh&&(le=le.value.slice(0,le.value.length-C)),le&&he.push(le);return he}function h(){s(cj,SyntaxError);let _=f();if(s(oS))return _;if(s(fj)){let C=v();return s(oS,SyntaxError),x({type:"select",selector:_},C)}throw new SyntaxError("Unclosed placeable")}function f(){if(e[t]==="{")return h();if(i(nS)){let[,_,C,R=null]=o(nS);if(_==="$")return{type:"var",name:C};if(s(hj)){let ge=p();if(_==="-")return{type:"term",name:C,attr:R,args:ge};if(rj.test(C))return{type:"func",name:C,args:ge};throw new SyntaxError("Function names must be all upper-case")}return _==="-"?{type:"term",name:C,attr:R,args:[]}:{type:"mesg",name:C,attr:R}}return y()}function p(){let _=[];for(;;){switch(e[t]){case")":return t++,_;case void 0:throw new SyntaxError("Unclosed argument list")}_.push(g()),s(gj)}}function g(){let _=f();return _.type!=="mesg"?_:s(pj)?{type:"narg",name:_.name,value:y()}:_}function v(){let _=[],C=0,R;for(;i(nj);){r("*")&&(R=C);let ge=m(),he=u();if(he===null)throw new SyntaxError("Expected variant value");_[C++]={key:ge,value:he}}if(C===0)return null;if(R===void 0)throw new SyntaxError("Expected default variant");return{variants:_,star:R}}function m(){s(uj,SyntaxError);let _;return i(Ly)?_=b():_={type:"str",value:a(ij)},s(dj,SyntaxError),_}function y(){if(i(Ly))return b();if(e[t]==='"')return w();throw new SyntaxError("Invalid expression")}function b(){let[,_,C=""]=o(Ly),R=C.length;return{type:"num",value:parseFloat(_),precision:R}}function w(){r('"',SyntaxError);let _="";for(;;){if(_+=a(sj),e[t]==="\\"){_+=E();continue}if(r('"'))return{type:"str",value:_};throw new SyntaxError("Unclosed string literal")}}function E(){if(i(iS))return a(iS);if(i(rS)){let[,_,C]=o(rS),R=parseInt(_||C,16);return R<=55295||57344<=R?String.fromCodePoint(R):"\uFFFD"}throw new SyntaxError("Unknown escape sequence")}function S(){let _=t;switch(s(mj),e[t]){case".":case"[":case"*":case"}":case void 0:return!1;case"{":return M(e.slice(_,t))}return e[t-1]===" "?M(e.slice(_,t)):!1}function I(_,C){return _.replace(C,"")}function M(_){let C=_.replace(aj,` `),R=lj.exec(_)[1].length;return new Mh(C,R)}}},Mh=class{constructor(e,t){this.value=e,this.length=t}},vj=/<|&#?\w+;/,yj={"http://www.w3.org/1999/xhtml":["em","strong","small","s","cite","q","dfn","abbr","data","time","code","var","samp","kbd","sub","sup","i","b","u","mark","bdi","bdo","span","br","wbr"]},bj={"http://www.w3.org/1999/xhtml":{global:["title","aria-label","aria-valuetext"],a:["download"],area:["download","alt"],input:["alt","placeholder"],menuitem:["label"],menu:["label"],optgroup:["label"],option:["label"],track:["label"],img:["alt"],textarea:["placeholder"],th:["abbr"]},"http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":{global:["accesskey","aria-label","aria-valuetext","label","title","tooltiptext"],description:["value"],key:["key","keycode"],label:["value"],textbox:["placeholder","value"]}};function wj(n,e){let{value:t}=e;if(typeof t=="string")if(n.localName==="title"&&n.namespaceURI==="http://www.w3.org/1999/xhtml")n.textContent=t;else if(!vj.test(t))n.textContent=t;else{let i=n.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml","template");i.innerHTML=t,_j(i.content,n)}vS(e,n)}function _j(n,e){for(let t of n.childNodes)if(t.nodeType!==t.TEXT_NODE){if(t.hasAttribute("data-l10n-name")){let i=Cj(e,t);n.replaceChild(i,t);continue}if(Dj(t)){let i=Aj(t);n.replaceChild(i,t);continue}console.warn(`An element of forbidden type "${t.localName}" was found in the translation. Only safe text-level elements and elements with data-l10n-name are allowed.`),n.replaceChild(qy(t),t)}e.textContent="",e.appendChild(n)}function Ej(n,e){if(!n)return!1;for(let t of n)if(t.name===e)return!0;return!1}function vS(n,e){let t=e.hasAttribute("data-l10n-attrs")?e.getAttribute("data-l10n-attrs").split(",").map(i=>i.trim()):null;for(let i of Array.from(e.attributes))aS(i.name,e,t)&&!Ej(n.attributes,i.name)&&e.removeAttribute(i.name);if(n.attributes)for(let i of Array.from(n.attributes))aS(i.name,e,t)&&e.getAttribute(i.name)!==i.value&&e.setAttribute(i.name,i.value)}function Cj(n,e){let t=e.getAttribute("data-l10n-name"),i=n.querySelector(`[data-l10n-name="${t}"]`);if(!i)return console.warn(`An element named "${t}" wasn't found in the source.`),qy(e);if(i.localName!==e.localName)return console.warn(`An element named "${t}" was found in the translation but its type ${e.localName} didn't match the element found in the source (${i.localName}).`),qy(e);n.removeChild(i);let r=i.cloneNode(!1);return yS(e,r)}function Aj(n){let e=n.ownerDocument.createElement(n.localName);return yS(n,e)}function qy(n){return n.ownerDocument.createTextNode(n.textContent)}function Dj(n){let e=yj[n.namespaceURI];return e&&e.includes(n.localName)}function aS(n,e,t=null){if(t&&t.includes(n))return!0;let i=bj[e.namespaceURI];if(!i)return!1;let r=n.toLowerCase(),s=e.localName;if(i.global.includes(r))return!0;if(!i[s])return!1;if(i[s].includes(r))return!0;if(e.namespaceURI==="http://www.w3.org/1999/xhtml"&&s==="input"&&r==="value"){let o=e.type.toLowerCase();if(o==="submit"||o==="button"||o==="reset")return!0}return!1}function yS(n,e){return e.textContent=n.textContent,vS(n,e),e}var Yy=class extends Array{static from(e){return e instanceof this?e:new this(e)}};var Xy=class extends Yy{constructor(e){if(super(),Symbol.asyncIterator in Object(e))this.iterator=e[Symbol.asyncIterator]();else if(Symbol.iterator in Object(e))this.iterator=e[Symbol.iterator]();else throw new TypeError("Argument must implement the iteration protocol.")}[Symbol.asyncIterator](){let e=this,t=0;return{next(){return A(this,null,function*(){return e.length<=t&&e.push(e.iterator.next()),e[t++]})}}}touchNext(e=1){return A(this,null,function*(){let t=0;for(;t++!e.includes(t)),this.onChange(),this.resourceIds.length}formatWithFallback(e,t){return A(this,null,function*(){let i=[],r=!1;try{for(var s=xb(this.bundles),o,a,l;o=!(a=yield s.next()).done;o=!1){let c=a.value;r=!0;let u=Ij(t,c,e,i);if(u.size===0)break;if(typeof console<"u"){let d=c.locales[0],h=Array.from(u).join(", ");console.warn(`[fluent] Missing translations in ${d}: ${h}`)}}}catch{l=[a]}finally{try{o&&(a=s.return)&&(yield a.call(s))}finally{if(l)throw l[0]}}return!r&&typeof console<"u"&&console.warn(`[fluent] Request for keys failed because no resource bundles got generated. keys: ${JSON.stringify(e)}. resourceIds: ${JSON.stringify(this.resourceIds)}.`),i})}formatMessages(e){return this.formatWithFallback(e,xj)}formatValues(e){return this.formatWithFallback(e,Sj)}formatValue(e,t){return A(this,null,function*(){let[i]=yield this.formatValues([{id:e,args:t}]);return i})}handleEvent(){this.onChange()}onChange(e=!1){this.bundles=Xy.from(this.generateBundles(this.resourceIds)),e&&this.bundles.touchNext(2)}};function Sj(n,e,t,i){return t.value?n.formatPattern(t.value,i,e):null}function xj(n,e,t,i){let r={value:null,attributes:null};t.value&&(r.value=n.formatPattern(t.value,i,e));let s=Object.keys(t.attributes);if(s.length>0){r.attributes=new Array(s.length);for(let[o,a]of s.entries()){let l=n.formatPattern(t.attributes[a],i,e);r.attributes[o]={name:a,value:l}}}return r}function Ij(n,e,t,i){let r=[],s=new Set;return t.forEach(({id:o,args:a},l)=>{if(i[l]!==void 0)return;let c=e.getMessage(o);if(c){if(r.length=0,i[l]=n(e,r,c,a),r.length>0&&typeof console<"u"){let u=e.locales[0],d=r.join(", ");console.warn(`[fluent][resolver] errors in ${u}/${o}: ${d}.`)}}else s.add(o)}),s}var Br="data-l10n-id",ll="data-l10n-args",Tj=`[${Br}]`,Zy=class extends Ky{constructor(e,t){super(e,t),this.roots=new Set,this.pendingrAF=null,this.pendingElements=new Set,this.windowElement=null,this.mutationObserver=null,this.observerConfig={attributes:!0,characterData:!1,childList:!0,subtree:!0,attributeFilter:[Br,ll]}}onChange(e=!1){super.onChange(e),this.roots&&this.translateRoots()}setAttributes(e,t,i){return e.setAttribute(Br,t),i?e.setAttribute(ll,JSON.stringify(i)):e.removeAttribute(ll),e}getAttributes(e){return{id:e.getAttribute(Br),args:JSON.parse(e.getAttribute(ll)||null)}}connectRoot(e){for(let t of this.roots)if(t===e||t.contains(e)||e.contains(t))throw new Error("Cannot add a root that overlaps with existing root.");if(this.windowElement){if(this.windowElement!==e.ownerDocument.defaultView)throw new Error(`Cannot connect a root: DOMLocalization already has a root from a different window.`)}else this.windowElement=e.ownerDocument.defaultView,this.mutationObserver=new this.windowElement.MutationObserver(t=>this.translateMutations(t));this.roots.add(e),this.mutationObserver.observe(e,this.observerConfig)}disconnectRoot(e){return this.roots.delete(e),this.pauseObserving(),this.roots.size===0?(this.mutationObserver=null,this.windowElement&&this.pendingrAF&&this.windowElement.cancelAnimationFrame(this.pendingrAF),this.windowElement=null,this.pendingrAF=null,this.pendingElements.clear(),!0):(this.resumeObserving(),!1)}translateRoots(){let e=Array.from(this.roots);return Promise.all(e.map(t=>this.translateFragment(t)))}pauseObserving(){this.mutationObserver&&(this.translateMutations(this.mutationObserver.takeRecords()),this.mutationObserver.disconnect())}resumeObserving(){if(this.mutationObserver)for(let e of this.roots)this.mutationObserver.observe(e,this.observerConfig)}translateMutations(e){for(let t of e)switch(t.type){case"attributes":t.target.hasAttribute("data-l10n-id")&&this.pendingElements.add(t.target);break;case"childList":for(let i of t.addedNodes)if(i.nodeType===i.ELEMENT_NODE)if(i.childElementCount)for(let r of this.getTranslatables(i))this.pendingElements.add(r);else i.hasAttribute(Br)&&this.pendingElements.add(i);break}this.pendingElements.size>0&&this.pendingrAF===null&&(this.pendingrAF=this.windowElement.requestAnimationFrame(()=>{this.translateElements(Array.from(this.pendingElements)),this.pendingElements.clear(),this.pendingrAF=null}))}translateFragment(e){return this.translateElements(this.getTranslatables(e))}translateElements(e){return A(this,null,function*(){if(!e.length)return;let t=e.map(this.getKeysForElement),i=yield this.formatMessages(t);return this.applyTranslations(e,i)})}applyTranslations(e,t){this.pauseObserving();for(let i=0;i({id:o})),(yield this.#i.formatMessages(e)).map(o=>o.value)):(yield this.#i.formatMessages([{id:e,args:t}]))[0]?.value||i})}translate(e){return A(this,null,function*(){(this.#t||=new Set).add(e);try{this.#i.connectRoot(e),yield this.#i.translateRoots()}catch{}})}translateOnce(e){return A(this,null,function*(){try{yield this.#i.translateElements([e])}catch(t){console.error(`translateOnce: "${t}".`)}})}destroy(){return A(this,null,function*(){if(this.#t){for(let e of this.#t)this.#i.disconnectRoot(e);this.#t.clear(),this.#t=null}this.#i.pauseObserving()})}pause(){this.#i.pauseObserving()}resume(){this.#i.resumeObserving()}static#r(e){return e=e?.toLowerCase()||"en-us",{en:"en-us",es:"es-es",fy:"fy-nl",ga:"ga-ie",gu:"gu-in",hi:"hi-in",hy:"hy-am",nb:"nb-no",ne:"ne-np",nn:"nn-no",pa:"pa-in",pt:"pt-pt",sv:"sv-se",zh:"zh-cn"}[e]||e}static#s(e){let t=e.split("-",1)[0];return["ar","he","fa","ps","ur"].includes(t)}};function lS(n,e){let t=new Gy(e),i=new Wy(n),r=i.addResource(t);return r.length&&console.error("L10n errors",r),i}var lo=class n extends Qy{constructor(e){super({lang:e});let t=e?n.#e.bind(n,"en-us",this.getLanguage()):n.#i.bind(n,this.getLanguage());this._setL10n(new Zy([],t))}static#e(e,t){return Yh(this,null,function*(){let{baseURL:i,paths:r}=yield new ml(this.#n()),s=[t];if(e!==t){let o=t.split("-",1)[0];o!==t&&s.push(o),s.push(e)}for(let o of s){let a=yield new ml(this.#t(o,i,r));a?yield a:o==="en-us"&&(yield this.#r(o))}})}static#t(e,t,i){return A(this,null,function*(){let r=i[e];if(!r)return null;let s=new URL(r,t),o=yield GD(s,"text");return lS(e,o)})}static#n(){return A(this,null,function*(){try{let{href:e}=document.querySelector('link[type="application/l10n"]'),t=yield GD(e,"json");return{baseURL:e.replace(/[^/]*$/,"")||"./",paths:t}}catch{}return{baseURL:"./",paths:Object.create(null)}})}static#i(e){return Yh(this,null,function*(){yield this.#r(e)})}static#r(e){return A(this,null,function*(){return lS(e,`pdfjs-previous-button = .title = Previous Page pdfjs-previous-button-label = Previous pdfjs-next-button = .title = Next Page pdfjs-next-button-label = Next pdfjs-page-input = .title = Page pdfjs-of-pages = of { $pagesCount } pdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount }) pdfjs-zoom-out-button = .title = Zoom Out pdfjs-zoom-out-button-label = Zoom Out pdfjs-zoom-in-button = .title = Zoom In pdfjs-zoom-in-button-label = Zoom In pdfjs-zoom-select = .title = Zoom pdfjs-presentation-mode-button = .title = Switch to Presentation Mode pdfjs-presentation-mode-button-label = Presentation Mode pdfjs-open-file-button = .title = Open File pdfjs-open-file-button-label = Open pdfjs-print-button = .title = Print pdfjs-print-button-label = Print pdfjs-save-button = .title = Save pdfjs-save-button-label = Save pdfjs-download-button = .title = Download pdfjs-download-button-label = Download pdfjs-bookmark-button = .title = Current Page (View URL from Current Page) pdfjs-bookmark-button-label = Current Page pdfjs-tools-button = .title = Tools pdfjs-tools-button-label = Tools pdfjs-first-page-button = .title = Go to First Page pdfjs-first-page-button-label = Go to First Page pdfjs-last-page-button = .title = Go to Last Page pdfjs-last-page-button-label = Go to Last Page pdfjs-page-rotate-cw-button = .title = Rotate Clockwise pdfjs-page-rotate-cw-button-label = Rotate Clockwise pdfjs-page-rotate-ccw-button = .title = Rotate Counterclockwise pdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise pdfjs-cursor-text-select-tool-button = .title = Enable Text Selection Tool pdfjs-cursor-text-select-tool-button-label = Text Selection Tool pdfjs-cursor-hand-tool-button = .title = Enable Hand Tool pdfjs-cursor-hand-tool-button-label = Hand Tool pdfjs-scroll-page-button = .title = Use Page Scrolling pdfjs-scroll-page-button-label = Page Scrolling pdfjs-scroll-vertical-button = .title = Use Vertical Scrolling pdfjs-scroll-vertical-button-label = Vertical Scrolling pdfjs-scroll-horizontal-button = .title = Use Horizontal Scrolling pdfjs-scroll-horizontal-button-label = Horizontal Scrolling pdfjs-scroll-wrapped-button = .title = Use Wrapped Scrolling pdfjs-scroll-wrapped-button-label = Wrapped Scrolling pdfjs-spread-none-button = .title = Do not join page spreads pdfjs-spread-none-button-label = No Spreads pdfjs-spread-odd-button = .title = Join page spreads starting with odd-numbered pages pdfjs-spread-odd-button-label = Odd Spreads pdfjs-spread-even-button = .title = Join page spreads starting with even-numbered pages pdfjs-spread-even-button-label = Even Spreads pdfjs-document-properties-button = .title = Document Properties\u2026 pdfjs-document-properties-button-label = Document Properties\u2026 pdfjs-document-properties-file-name = File name: pdfjs-document-properties-file-size = File size: pdfjs-document-properties-size-kb = { NUMBER($kb, maximumSignificantDigits: 3) } KB ({ $b } bytes) pdfjs-document-properties-size-mb = { NUMBER($mb, maximumSignificantDigits: 3) } MB ({ $b } bytes) pdfjs-document-properties-title = Title: pdfjs-document-properties-author = Author: pdfjs-document-properties-subject = Subject: pdfjs-document-properties-keywords = Keywords: pdfjs-document-properties-creation-date = Creation Date: pdfjs-document-properties-modification-date = Modification Date: pdfjs-document-properties-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } pdfjs-document-properties-creator = Creator: pdfjs-document-properties-producer = PDF Producer: pdfjs-document-properties-version = PDF Version: pdfjs-document-properties-page-count = Page Count: pdfjs-document-properties-page-size = Page Size: pdfjs-document-properties-page-size-unit-inches = in pdfjs-document-properties-page-size-unit-millimeters = mm pdfjs-document-properties-page-size-orientation-portrait = portrait pdfjs-document-properties-page-size-orientation-landscape = landscape pdfjs-document-properties-page-size-name-a-three = A3 pdfjs-document-properties-page-size-name-a-four = A4 pdfjs-document-properties-page-size-name-letter = Letter pdfjs-document-properties-page-size-name-legal = Legal pdfjs-document-properties-page-size-dimension-string = { $width } \xD7 { $height } { $unit } ({ $orientation }) pdfjs-document-properties-page-size-dimension-name-string = { $width } \xD7 { $height } { $unit } ({ $name }, { $orientation }) pdfjs-document-properties-linearized = Fast Web View: pdfjs-document-properties-linearized-yes = Yes pdfjs-document-properties-linearized-no = No pdfjs-document-properties-close-button = Close pdfjs-print-progress-message = Preparing document for printing\u2026 pdfjs-print-progress-percent = { $progress }% pdfjs-print-progress-close-button = Cancel pdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser. pdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing. pdfjs-toggle-sidebar-button = .title = Toggle Sidebar pdfjs-toggle-sidebar-notification-button = .title = Toggle Sidebar (document contains outline/attachments/layers) pdfjs-toggle-sidebar-button-label = Toggle Sidebar pdfjs-document-outline-button = .title = Show Document Outline (double-click to expand/collapse all items) pdfjs-document-outline-button-label = Document Outline pdfjs-attachments-button = .title = Show Attachments pdfjs-attachments-button-label = Attachments pdfjs-layers-button = .title = Show Layers (double-click to reset all layers to the default state) pdfjs-layers-button-label = Layers pdfjs-thumbs-button = .title = Show Thumbnails pdfjs-thumbs-button-label = Thumbnails pdfjs-current-outline-item-button = .title = Find Current Outline Item pdfjs-current-outline-item-button-label = Current Outline Item pdfjs-findbar-button = .title = Find in Document pdfjs-findbar-button-label = Find pdfjs-additional-layers = Additional Layers pdfjs-thumb-page-title = .title = Page { $page } pdfjs-thumb-page-canvas = .aria-label = Thumbnail of Page { $page } pdfjs-find-input = .title = Find .placeholder = Find in document\u2026 pdfjs-find-previous-button = .title = Find the previous occurrence of the phrase pdfjs-find-previous-button-label = Previous pdfjs-find-next-button = .title = Find the next occurrence of the phrase pdfjs-find-next-button-label = Next pdfjs-find-highlight-checkbox = Highlight All pdfjs-find-match-case-checkbox-label = Match Case pdfjs-find-match-diacritics-checkbox-label = Match Diacritics pdfjs-find-entire-word-checkbox-label = Whole Words pdfjs-find-reached-top = Reached top of document, continued from bottom pdfjs-find-reached-bottom = Reached end of document, continued from top pdfjs-find-match-count = { $total -> [one] { $current } of { $total } match *[other] { $current } of { $total } matches } pdfjs-find-match-count-limit = { $limit -> [one] More than { $limit } match *[other] More than { $limit } matches } pdfjs-find-not-found = Phrase not found pdfjs-page-scale-width = Page Width pdfjs-page-scale-fit = Page Fit pdfjs-page-scale-auto = Automatic Zoom pdfjs-page-scale-actual = Actual Size pdfjs-page-scale-percent = { $scale }% pdfjs-page-landmark = .aria-label = Page { $page } pdfjs-loading-error = An error occurred while loading the PDF. pdfjs-invalid-file-error = Invalid or corrupted PDF file. pdfjs-missing-file-error = Missing PDF file. pdfjs-unexpected-response-error = Unexpected server response. pdfjs-rendering-error = An error occurred while rendering the page. pdfjs-annotation-date-time-string = { DATETIME($dateObj, dateStyle: "short", timeStyle: "medium") } pdfjs-text-annotation-type = .alt = [{ $type } Annotation] pdfjs-password-label = Enter the password to open this PDF file. pdfjs-password-invalid = Invalid password. Please try again. pdfjs-password-ok-button = OK pdfjs-password-cancel-button = Cancel pdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts. pdfjs-editor-free-text-button = .title = Text pdfjs-editor-free-text-button-label = Text pdfjs-editor-ink-button = .title = Draw pdfjs-editor-ink-button-label = Draw pdfjs-editor-stamp-button = .title = Add or edit images pdfjs-editor-stamp-button-label = Add or edit images pdfjs-editor-highlight-button = .title = Highlight pdfjs-editor-highlight-button-label = Highlight pdfjs-highlight-floating-button1 = .title = Highlight .aria-label = Highlight pdfjs-highlight-floating-button-label = Highlight pdfjs-editor-remove-ink-button = .title = Remove drawing pdfjs-editor-remove-freetext-button = .title = Remove text pdfjs-editor-remove-stamp-button = .title = Remove image pdfjs-editor-remove-highlight-button = .title = Remove highlight pdfjs-editor-free-text-color-input = Color pdfjs-editor-free-text-size-input = Size pdfjs-editor-ink-color-input = Color pdfjs-editor-ink-thickness-input = Thickness pdfjs-editor-ink-opacity-input = Opacity pdfjs-editor-stamp-add-image-button = .title = Add image pdfjs-editor-stamp-add-image-button-label = Add image pdfjs-editor-free-highlight-thickness-input = Thickness pdfjs-editor-free-highlight-thickness-title = .title = Change thickness when highlighting items other than text pdfjs-free-text2 = .aria-label = Text Editor .default-content = Start typing\u2026 pdfjs-ink = .aria-label = Draw Editor pdfjs-ink-canvas = .aria-label = User-created image pdfjs-editor-alt-text-button = .aria-label = Alt text pdfjs-editor-alt-text-button-label = Alt text pdfjs-editor-alt-text-edit-button = .aria-label = Edit alt text pdfjs-editor-alt-text-dialog-label = Choose an option pdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can\u2019t see the image or when it doesn\u2019t load. pdfjs-editor-alt-text-add-description-label = Add a description pdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions. pdfjs-editor-alt-text-mark-decorative-label = Mark as decorative pdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks. pdfjs-editor-alt-text-cancel-button = Cancel pdfjs-editor-alt-text-save-button = Save pdfjs-editor-alt-text-decorative-tooltip = Marked as decorative pdfjs-editor-alt-text-textarea = .placeholder = For example, \u201CA young man sits down at a table to eat a meal\u201D pdfjs-editor-resizer-top-left = .aria-label = Top left corner \u2014 resize pdfjs-editor-resizer-top-middle = .aria-label = Top middle \u2014 resize pdfjs-editor-resizer-top-right = .aria-label = Top right corner \u2014 resize pdfjs-editor-resizer-middle-right = .aria-label = Middle right \u2014 resize pdfjs-editor-resizer-bottom-right = .aria-label = Bottom right corner \u2014 resize pdfjs-editor-resizer-bottom-middle = .aria-label = Bottom middle \u2014 resize pdfjs-editor-resizer-bottom-left = .aria-label = Bottom left corner \u2014 resize pdfjs-editor-resizer-middle-left = .aria-label = Middle left \u2014 resize pdfjs-editor-highlight-colorpicker-label = Highlight color pdfjs-editor-colorpicker-button = .title = Change color pdfjs-editor-colorpicker-dropdown = .aria-label = Color choices pdfjs-editor-colorpicker-yellow = .title = Yellow pdfjs-editor-colorpicker-green = .title = Green pdfjs-editor-colorpicker-blue = .title = Blue pdfjs-editor-colorpicker-pink = .title = Pink pdfjs-editor-colorpicker-red = .title = Red pdfjs-editor-highlight-show-all-button-label = Show all pdfjs-editor-highlight-show-all-button = .title = Show all pdfjs-editor-new-alt-text-dialog-edit-label = Edit alt text (image description) pdfjs-editor-new-alt-text-dialog-add-label = Add alt text (image description) pdfjs-editor-new-alt-text-textarea = .placeholder = Write your description here\u2026 pdfjs-editor-new-alt-text-description = Short description for people who can\u2019t see the image or when the image doesn\u2019t load. pdfjs-editor-new-alt-text-disclaimer1 = This alt text was created automatically and may be inaccurate. pdfjs-editor-new-alt-text-disclaimer-learn-more-url = Learn more pdfjs-editor-new-alt-text-create-automatically-button-label = Create alt text automatically pdfjs-editor-new-alt-text-not-now-button = Not now pdfjs-editor-new-alt-text-error-title = Couldn\u2019t create alt text automatically pdfjs-editor-new-alt-text-error-description = Please write your own alt text or try again later. pdfjs-editor-new-alt-text-error-close-button = Close pdfjs-editor-new-alt-text-ai-model-downloading-progress = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB) .aria-valuetext = Downloading alt text AI model ({ $downloadedSize } of { $totalSize } MB) pdfjs-editor-new-alt-text-added-button = .aria-label = Alt text added pdfjs-editor-new-alt-text-added-button-label = Alt text added pdfjs-editor-new-alt-text-missing-button = .aria-label = Missing alt text pdfjs-editor-new-alt-text-missing-button-label = Missing alt text pdfjs-editor-new-alt-text-to-review-button = .aria-label = Review alt text pdfjs-editor-new-alt-text-to-review-button-label = Review alt text pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer = Created automatically: { $generatedAltText } pdfjs-image-alt-text-settings-button = .title = Image alt text settings pdfjs-image-alt-text-settings-button-label = Image alt text settings pdfjs-editor-alt-text-settings-dialog-label = Image alt text settings pdfjs-editor-alt-text-settings-automatic-title = Automatic alt text pdfjs-editor-alt-text-settings-create-model-button-label = Create alt text automatically pdfjs-editor-alt-text-settings-create-model-description = Suggests descriptions to help people who can\u2019t see the image or when the image doesn\u2019t load. pdfjs-editor-alt-text-settings-download-model-label = Alt text AI model ({ $totalSize } MB) pdfjs-editor-alt-text-settings-ai-model-description = Runs locally on your device so your data stays private. Required for automatic alt text. pdfjs-editor-alt-text-settings-delete-model-button = Delete pdfjs-editor-alt-text-settings-download-model-button = Download pdfjs-editor-alt-text-settings-downloading-model-button = Downloading\u2026 pdfjs-editor-alt-text-settings-editor-title = Alt text editor pdfjs-editor-alt-text-settings-show-dialog-button-label = Show alt text editor right away when adding an image pdfjs-editor-alt-text-settings-show-dialog-description = Helps you make sure all your images have alt text. pdfjs-editor-alt-text-settings-close-button = Close`)})}},Mj=1e3,Fy=50,cS=1e3;function Vy(){return document.location.hash}var Jy=class{#e=null;constructor({linkService:e,eventBus:t}){this.linkService=e,this.eventBus=t,this._initialized=!1,this._fingerprint="",this.reset(),this.eventBus._on("pagesinit",()=>{this._isPagesLoaded=!1,this.eventBus._on("pagesloaded",i=>{this._isPagesLoaded=!!i.pagesCount},{once:!0})})}initialize({fingerprint:e,resetHistory:t=!1,updateUrl:i=!1}){if(!e||typeof e!="string"){console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');return}this._initialized&&this.reset();let r=this._fingerprint!==""&&this._fingerprint!==e;this._fingerprint=e,this._updateUrl=i===!0,this._initialized=!0,this.#d();let s=window.history.state;if(this._popStateInProgress=!1,this._blockHashChange=0,this._currentHash=Vy(),this._numPositionUpdates=0,this._uid=this._maxUid=0,this._destination=null,this._position=null,!this.#r(s,!0)||t){let{hash:a,page:l,rotation:c}=this.#l(!0);if(!a||r||t){this.#t(null,!0);return}this.#t({hash:a,page:l,rotation:c},!0);return}let o=s.destination;this.#s(o,s.uid,!0),o.rotation!==void 0&&(this._initialRotation=o.rotation),o.dest?(this._initialBookmark=JSON.stringify(o.dest),this._destination.page=null):o.hash?this._initialBookmark=o.hash:o.page&&(this._initialBookmark=`page=${o.page}`)}reset(){this._initialized&&(this.#a(),this._initialized=!1,this.#o()),this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._initialBookmark=null,this._initialRotation=null}push({namedDest:e=null,explicitDest:t,pageNumber:i}){if(!this._initialized)return;if(e&&typeof e!="string"){console.error(`PDFHistory.push: "${e}" is not a valid namedDest parameter.`);return}else if(Array.isArray(t)){if(!this.#i(i)&&(i!==null||this._destination)){console.error(`PDFHistory.push: "${i}" is not a valid pageNumber parameter.`);return}}else{console.error(`PDFHistory.push: "${t}" is not a valid explicitDest parameter.`);return}let r=e||JSON.stringify(t);if(!r)return;let s=!1;if(this._destination&&(Rj(this._destination.hash,r)||Pj(this._destination.dest,t))){if(this._destination.page)return;s=!0}this._popStateInProgress&&!s||(this.#t({dest:t,hash:r,page:i,rotation:this.linkService.rotation},s),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1})))}pushPage(e){if(this._initialized){if(!this.#i(e)){console.error(`PDFHistory.pushPage: "${e}" is not a valid page number.`);return}this._destination?.page!==e&&(this._popStateInProgress||(this.#t({dest:null,hash:`page=${e}`,page:e,rotation:this.linkService.rotation}),this._popStateInProgress||(this._popStateInProgress=!0,Promise.resolve().then(()=>{this._popStateInProgress=!1}))))}}pushCurrentPosition(){!this._initialized||this._popStateInProgress||this.#n()}back(){if(!this._initialized||this._popStateInProgress)return;let e=window.history.state;this.#r(e)&&e.uid>0&&window.history.back()}forward(){if(!this._initialized||this._popStateInProgress)return;let e=window.history.state;this.#r(e)&&e.uid0)}get initialBookmark(){return this._initialized?this._initialBookmark:null}get initialRotation(){return this._initialized?this._initialRotation:null}#t(e,t=!1){let i=t||!this._destination,r={fingerprint:this._fingerprint,uid:i?this._uid:this._uid+1,destination:e};this.#s(e,r.uid);let s;if(this._updateUrl&&e?.hash){let o=document.location.href.split("#",1)[0];o.startsWith("file://")||(s=`${o}#${e.hash}`)}i?window.history.replaceState(r,"",s):window.history.pushState(r,"",s)}#n(e=!1){if(!this._position)return;let t=this._position;if(e&&(t=Object.assign(Object.create(null),this._position),t.temporary=!0),!this._destination){this.#t(t);return}if(this._destination.temporary){this.#t(t,!0);return}if(this._destination.hash===t.hash||!this._destination.page&&(Fy<=0||this._numPositionUpdates<=Fy))return;let i=!1;if(this._destination.page>=t.first&&this._destination.page<=t.page){if(this._destination.dest!==void 0||!this._destination.first)return;i=!0}this.#t(t,i)}#i(e){return Number.isInteger(e)&&e>0&&e<=this.linkService.pagesCount}#r(e,t=!1){if(!e)return!1;if(e.fingerprint!==this._fingerprint)if(t){if(typeof e.fingerprint!="string"||e.fingerprint.length!==this._fingerprint.length)return!1;let[i]=performance.getEntriesByType("navigation");if(i?.type!=="reload")return!1}else return!1;return!(!Number.isInteger(e.uid)||e.uid<0||e.destination===null||typeof e.destination!="object")}#s(e,t,i=!1){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),i&&e?.temporary&&delete e.temporary,this._destination=e,this._uid=t,this._maxUid=Math.max(this._maxUid,t),this._numPositionUpdates=0}#l(e=!1){let t=unescape(Vy()).substring(1),i=Lh(t),r=i.get("nameddest")||"",s=i.get("page")|0;return(!this.#i(s)||e&&r.length>0)&&(s=null),{hash:t,page:s,rotation:this.linkService.rotation}}#c({location:e}){this._updateViewareaTimeout&&(clearTimeout(this._updateViewareaTimeout),this._updateViewareaTimeout=null),this._position={hash:e.pdfOpenParams.substring(1),page:this.linkService.page,first:e.pageNumber,rotation:e.rotation},!this._popStateInProgress&&(Fy>0&&this._isPagesLoaded&&this._destination&&!this._destination.page&&this._numPositionUpdates++,cS>0&&(this._updateViewareaTimeout=setTimeout(()=>{this._popStateInProgress||this.#n(!0),this._updateViewareaTimeout=null},cS)))}#u({state:e}){let t=Vy(),i=this._currentHash!==t;if(this._currentHash=t,!e){this._uid++;let{hash:s,page:o,rotation:a}=this.#l();this.#t({hash:s,page:o,rotation:a},!0);return}if(!this.#r(e))return;this._popStateInProgress=!0,i&&(this._blockHashChange++,zV({target:window,name:"hashchange",delay:Mj}).then(()=>{this._blockHashChange--}));let r=e.destination;this.#s(r,e.uid,!0),gS(r.rotation)&&(this.linkService.rotation=r.rotation),r.dest?this.linkService.goToDestination(r.dest):r.hash?this.linkService.setHash(r.hash):r.page&&(this.linkService.page=r.page),Promise.resolve().then(()=>{this._popStateInProgress=!1})}#a(){(!this._destination||this._destination.temporary)&&this.#n()}#d(){if(this.#e)return;this.#e=new AbortController;let{signal:e}=this.#e;this.eventBus._on("updateviewarea",this.#c.bind(this),{signal:e}),window.addEventListener("popstate",this.#u.bind(this),{signal:e}),window.addEventListener("pagehide",this.#a.bind(this),{signal:e})}#o(){this.#e?.abort(),this.#e=null}};function Rj(n,e){return typeof n!="string"||typeof e!="string"?!1:n===e||Lh(n).get("nameddest")===e}function Pj(n,e){function t(i,r){if(typeof i!=typeof r||Array.isArray(i)||Array.isArray(r))return!1;if(i!==null&&typeof i=="object"&&r!==null){if(Object.keys(i).length!==Object.keys(r).length)return!1;for(let s in i)if(!t(i[s],r[s]))return!1;return!0}return i===r||Number.isNaN(i)&&Number.isNaN(r)}if(!(Array.isArray(n)&&Array.isArray(e))||n.length!==e.length)return!1;for(let i=0,r=n.length;i1;(function(){(r||i)&&Ah.set("maxCanvasPixels",5242880)})(),function(){i&&Ah.set("useSystemFonts",!1)}()}var Ah,D={BROWSER:1,VIEWER:2,API:4,WORKER:8,EVENT_DISPATCH:16,PREFERENCE:128},tb={BOOLEAN:1,NUMBER:2,OBJECT:4,STRING:8,UNDEFINED:16},zn={allowedGlobalEvents:{value:null,kind:D.BROWSER},canvasMaxAreaInBytes:{value:-1,kind:D.BROWSER+D.API},isInAutomation:{value:!1,kind:D.BROWSER},localeProperties:{value:{lang:navigator.language||"en-US"},kind:D.BROWSER},nimbusDataStr:{value:"",kind:D.BROWSER},supportsCaretBrowsingMode:{value:!1,kind:D.BROWSER},supportsDocumentFonts:{value:!0,kind:D.BROWSER},supportsIntegratedFind:{value:!1,kind:D.BROWSER},supportsMouseWheelZoomCtrlKey:{value:!0,kind:D.BROWSER},supportsMouseWheelZoomMetaKey:{value:!0,kind:D.BROWSER},supportsPinchToZoom:{value:!0,kind:D.BROWSER},toolbarDensity:{value:0,kind:D.BROWSER+D.EVENT_DISPATCH},altTextLearnMoreUrl:{value:"",kind:D.VIEWER+D.PREFERENCE},annotationEditorMode:{value:0,kind:D.VIEWER+D.PREFERENCE},annotationMode:{value:2,kind:D.VIEWER+D.PREFERENCE},cursorToolOnLoad:{value:0,kind:D.VIEWER+D.PREFERENCE},debuggerSrc:{value:"./debugger.mjs",kind:D.VIEWER},defaultZoomDelay:{value:400,kind:D.VIEWER+D.PREFERENCE},defaultZoomValue:{value:"",kind:D.VIEWER+D.PREFERENCE},disableHistory:{value:!1,kind:D.VIEWER},disablePageLabels:{value:!1,kind:D.VIEWER+D.PREFERENCE},enableAltText:{value:!1,kind:D.VIEWER+D.PREFERENCE},enableAltTextModelDownload:{value:!0,kind:D.VIEWER+D.PREFERENCE+D.EVENT_DISPATCH},enableGuessAltText:{value:!0,kind:D.VIEWER+D.PREFERENCE+D.EVENT_DISPATCH},enableHighlightFloatingButton:{value:!1,kind:D.VIEWER+D.PREFERENCE},enableNewAltTextWhenAddingImage:{value:!0,kind:D.VIEWER+D.PREFERENCE},enablePermissions:{value:!1,kind:D.VIEWER+D.PREFERENCE},enablePrintAutoRotate:{value:!0,kind:D.VIEWER+D.PREFERENCE},enableScripting:{value:!0,kind:D.VIEWER+D.PREFERENCE},enableUpdatedAddImage:{value:!1,kind:D.VIEWER+D.PREFERENCE},externalLinkRel:{value:"noopener noreferrer nofollow",kind:D.VIEWER},externalLinkTarget:{value:0,kind:D.VIEWER+D.PREFERENCE},highlightEditorColors:{value:"yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",kind:D.VIEWER+D.PREFERENCE},historyUpdateUrl:{value:!1,kind:D.VIEWER+D.PREFERENCE},ignoreDestinationZoom:{value:!1,kind:D.VIEWER+D.PREFERENCE},imageResourcesPath:{value:"./images/",kind:D.VIEWER},maxCanvasPixels:{value:2**25,kind:D.VIEWER},forcePageColors:{value:!1,kind:D.VIEWER+D.PREFERENCE},pageColorsBackground:{value:"Canvas",kind:D.VIEWER+D.PREFERENCE},pageColorsForeground:{value:"CanvasText",kind:D.VIEWER+D.PREFERENCE},pdfBugEnabled:{value:!1,kind:D.VIEWER+D.PREFERENCE},printResolution:{value:150,kind:D.VIEWER},sidebarViewOnLoad:{value:-1,kind:D.VIEWER+D.PREFERENCE},scrollModeOnLoad:{value:-1,kind:D.VIEWER+D.PREFERENCE},spreadModeOnLoad:{value:-1,kind:D.VIEWER+D.PREFERENCE},textLayerMode:{value:1,kind:D.VIEWER+D.PREFERENCE},viewOnLoad:{value:0,kind:D.VIEWER+D.PREFERENCE},cMapPacked:{value:!0,kind:D.API},cMapUrl:{value:"../web/cmaps/",kind:D.API},disableAutoFetch:{value:!1,kind:D.API+D.PREFERENCE},disableFontFace:{value:!1,kind:D.API+D.PREFERENCE},disableRange:{value:!1,kind:D.API+D.PREFERENCE},disableStream:{value:!1,kind:D.API+D.PREFERENCE},docBaseUrl:{value:"",kind:D.API},enableHWA:{value:!0,kind:D.API+D.VIEWER+D.PREFERENCE},enableXfa:{value:!0,kind:D.API+D.PREFERENCE},fontExtraProperties:{value:!1,kind:D.API},isEvalSupported:{value:!0,kind:D.API},isOffscreenCanvasSupported:{value:!0,kind:D.API},maxImageSize:{value:-1,kind:D.API},pdfBug:{value:!1,kind:D.API},standardFontDataUrl:{value:"../web/standard_fonts/",kind:D.API},useSystemFonts:{value:void 0,kind:D.API,type:tb.BOOLEAN+tb.UNDEFINED},verbosity:{value:1,kind:D.API},workerPort:{value:null,kind:D.WORKER},workerSrc:{value:"../build/pdf.worker.mjs",kind:D.WORKER}};zn.defaultUrl={value:"compressed.tracemonkey-pldi-09.pdf",kind:D.VIEWER},zn.sandboxBundleSrc={value:"../build/pdf.sandbox.mjs",kind:D.VIEWER},zn.viewerCssTheme={value:0,kind:D.VIEWER+D.PREFERENCE},zn.enableFakeMLManager={value:!0,kind:D.VIEWER};zn.disablePreferences={value:!1,kind:D.VIEWER};var nb=class{static eventBus;static#e=new Map;static{for(let e in zn)this.#e.set(e,zn[e].value);for(let[e,t]of Ah)this.#e.set(e,t);this._hasInvokedSet=!1,this._checkDisablePreferences=()=>this.get("disablePreferences")?!0:(this._hasInvokedSet&&console.warn('The Preferences may override manually set AppOptions; please use the "disablePreferences"-option to prevent that.'),!1)}static get(e){return this.#e.get(e)}static getAll(e=null,t=!1){let i=Object.create(null);for(let r in zn){let s=zn[r];e&&!(e&s.kind)||(i[r]=t?s.value:this.#e.get(r))}return i}static set(e,t){this.setAll({[e]:t})}static setAll(e,t=!1){this._hasInvokedSet||=!0;let i;for(let r in e){let s=zn[r],o=e[r];if(!s||!(typeof o==typeof s.value||tb[(typeof o).toUpperCase()]&s.type))continue;let{kind:a}=s;t&&!(a&D.BROWSER||a&D.PREFERENCE)||(this.eventBus&&a&D.EVENT_DISPATCH&&(i||=new Map).set(r,o),this.#e.set(r,o))}if(i)for(let[r,s]of i)this.eventBus.dispatch(r.toLowerCase(),{source:this,value:s})}},ib=class{#e=null;constructor(e){this.pageIndex=e.pageIndex}render(e="display"){return A(this,null,function*(){e!=="display"||this.#e||this._cancelled||(this.#e=new FV({pageIndex:this.pageIndex}))})}cancel(){this._cancelled=!0,this.#e&&(this.#e.destroy(),this.#e=null)}setParent(e){this.#e?.setParent(e)}getDrawLayer(){return this.#e}},uS={Document:null,DocumentFragment:null,Part:"group",Sect:"group",Div:"group",Aside:"note",NonStruct:"none",P:null,H:"heading",Title:null,FENote:"note",Sub:"group",Lbl:null,Span:null,Em:null,Strong:null,Link:"link",Annot:"note",Form:"form",Ruby:null,RB:null,RT:null,RP:null,Warichu:null,WT:null,WP:null,L:"list",LI:"listitem",LBody:null,Table:"table",TR:"row",TH:"columnheader",TD:"cell",THead:"columnheader",TBody:null,TFoot:null,Caption:null,Figure:"figure",Formula:null,Artifact:null},Nj=/^H(\d+)$/,Rh=class{#e;#t=null;#n;#i=new Map;#r;#s=null;constructor(e,t){this.#e=e.getStructTree(),this.#r=t}render(){return A(this,null,function*(){if(this.#n)return this.#n;let{promise:e,resolve:t,reject:i}=Promise.withResolvers();this.#n=e;try{this.#t=this.#u(yield this.#e)}catch(r){i(r)}return this.#e=null,this.#t?.classList.add("structTree"),t(this.#t),e})}getAriaAttributes(e){return A(this,null,function*(){try{return yield this.render(),this.#i.get(e)}catch{}return null})}hide(){this.#t&&!this.#t.hidden&&(this.#t.hidden=!0)}show(){this.#t?.hidden&&(this.#t.hidden=!1)}#l(e,t){let{alt:i,id:r,lang:s}=e;if(i!==void 0){let o=!1,a=ul(i);for(let l of e.children)if(l.type==="annotation"){let c=this.#i.get(l.id);c||(c=new Map,this.#i.set(l.id,c)),c.set("aria-label",a),o=!0}o||t.setAttribute("aria-label",a)}r!==void 0&&t.setAttribute("aria-owns",r),s!==void 0&&t.setAttribute("lang",ul(s,!0))}#c(e,t){let{alt:i,bbox:r,children:s}=e,o=s?.[0];if(!this.#r||!i||!r||o?.type!=="content")return!1;let{id:a}=o;if(!a)return!1;t.setAttribute("aria-owns",a);let l=document.createElement("span");(this.#s||=new Map).set(a,l),l.setAttribute("role","img"),l.setAttribute("aria-label",ul(i));let{pageHeight:c,pageX:u,pageY:d}=this.#r,h="calc(var(--scale-factor)*",{style:f}=l;return f.width=`${h}${r[2]-r[0]}px)`,f.height=`${h}${r[3]-r[1]}px)`,f.left=`${h}${r[0]-u}px)`,f.top=`${h}${c-r[3]+d}px)`,!0}addElementsToTextLayer(){if(this.#s){for(let[e,t]of this.#s)document.getElementById(e)?.append(t);this.#s.clear(),this.#s=null}}#u(e){if(!e)return null;let t=document.createElement("span");if("role"in e){let{role:i}=e,r=i.match(Nj);if(r?(t.setAttribute("role","heading"),t.setAttribute("aria-level",r[1])):uS[i]&&t.setAttribute("role",uS[i]),i==="Figure"&&this.#c(e,t))return t}if(this.#l(e,t),e.children)if(e.children.length===1&&"id"in e.children[0])this.#l(e.children[0],t);else for(let i of e.children)t.append(this.#u(i));return t}},rb=class n{#e=!1;#t=null;#n=new Map;#i=new Map;setTextMapping(e){this.#t=e}static#r(e,t){let i=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(i.width===0&&i.height===0)return 1;if(r.width===0&&r.height===0)return-1;let s=i.y,o=i.y+i.height,a=i.y+i.height/2,l=r.y,c=r.y+r.height,u=r.y+r.height/2;if(a<=l&&u>=o)return-1;if(u<=s&&a>=c)return 1;let d=i.x+i.width/2,h=r.x+r.width/2;return d-h}enable(){if(this.#e)throw new Error("TextAccessibilityManager is already enabled.");if(!this.#t)throw new Error("Text divs and strings have not been set.");if(this.#e=!0,this.#t=this.#t.slice(),this.#t.sort(n.#r),this.#n.size>0){let e=this.#t;for(let[t,i]of this.#n){if(!document.getElementById(t)){this.#n.delete(t);continue}this.#s(t,e[i])}}for(let[e,t]of this.#i)this.addPointerInTextLayer(e,t);this.#i.clear()}disable(){this.#e&&(this.#i.clear(),this.#t=null,this.#e=!1)}removePointerInTextLayer(e){if(!this.#e){this.#i.delete(e);return}let t=this.#t;if(!t||t.length===0)return;let{id:i}=e,r=this.#n.get(i);if(r===void 0)return;let s=t[r];this.#n.delete(i);let o=s.getAttribute("aria-owns");o?.includes(i)&&(o=o.split(" ").filter(a=>a!==i).join(" "),o?s.setAttribute("aria-owns",o):(s.removeAttribute("aria-owns"),s.setAttribute("role","presentation")))}#s(e,t){let i=t.getAttribute("aria-owns");i?.includes(e)||t.setAttribute("aria-owns",i?`${i} ${e}`:e),t.removeAttribute("role")}addPointerInTextLayer(e,t){let{id:i}=e;if(!i)return null;if(!this.#e)return this.#i.set(e,t),null;t&&this.removePointerInTextLayer(e);let r=this.#t;if(!r||r.length===0)return null;let s=dl(r,c=>n.#r(e,c)<0),o=Math.max(0,s-1),a=r[o];this.#s(i,a),this.#n.set(i,o);let l=a.parentNode;return l?.classList.contains("markedContent")?l.id:null}moveElementInDOM(e,t,i,r){let s=this.addPointerInTextLayer(i,r);if(!e.hasChildNodes())return e.append(t),s;let o=Array.from(e.childNodes).filter(c=>c!==t);if(o.length===0)return s;let a=i||t,l=dl(o,c=>n.#r(a,c)<0);return l===0?o[0].before(t):o[l-1].after(t),s}},sb=class{#e=null;constructor({findController:e,eventBus:t,pageIndex:i}){this.findController=e,this.matches=[],this.eventBus=t,this.pageIdx=i,this.textDivs=null,this.textContentItemsStr=null,this.enabled=!1}setTextMapping(e,t){this.textDivs=e,this.textContentItemsStr=t}enable(){if(!this.textDivs||!this.textContentItemsStr)throw new Error("Text divs and strings have not been set.");if(this.enabled)throw new Error("TextHighlighter is already enabled.");this.enabled=!0,this.#e||(this.#e=new AbortController,this.eventBus._on("updatetextlayermatches",e=>{(e.pageIndex===this.pageIdx||e.pageIndex===-1)&&this._updateMatches()},{signal:this.#e.signal})),this._updateMatches()}disable(){this.enabled&&(this.enabled=!1,this.#e?.abort(),this.#e=null,this._updateMatches(!0))}_convertMatches(e,t){if(!e)return[];let{textContentItemsStr:i}=this,r=0,s=0,o=i.length-1,a=[];for(let l=0,c=e.length;l=s+i[r].length;)s+=i[r].length,r++;r===i.length&&console.error("Could not find a matching mapping");let d={begin:{divIdx:r,offset:u-s}};for(u+=t[l];r!==o&&u>s+i[r].length;)s+=i[r].length,r++;d.end={divIdx:r,offset:u-s},a.push(d)}return a}_renderMatches(e){if(e.length===0)return;let{findController:t,pageIdx:i}=this,{textContentItemsStr:r,textDivs:s}=this,o=i===t.selected.pageIdx,a=t.selected.matchIdx,l=t.state.highlightAll,c=null,u={divIdx:-1,offset:void 0};function d(m,y){let b=m.divIdx;return s[b].textContent="",h(b,0,m.offset,y)}function h(m,y,b,w){let E=s[m];if(E.nodeType===Node.TEXT_NODE){let M=document.createElement("span");E.before(M),M.append(E),s[m]=M,E=M}let S=r[m].substring(y,b),I=document.createTextNode(S);if(w){let M=document.createElement("span");return M.className=`${w} appended`,M.append(I),E.append(M),w.includes("selected")?M.offsetLeft:0}return E.append(I),0}let f=a,p=f+1;if(l)f=0,p=e.length;else if(!o)return;let g=-1,v=-1;for(let m=f;m{t.classList.add("selecting")}),t.addEventListener("copy",i=>{if(!this.#e){let r=document.getSelection();i.clipboardData.setData("text/plain",ul(BV(r.toString())))}i.preventDefault(),i.stopPropagation()}),n.#r.set(t,e),n.#u()}static#c(e){this.#r.delete(e),this.#r.size===0&&(this.#s?.abort(),this.#s=null)}static#u(){if(this.#s)return;this.#s=new AbortController;let{signal:e}=this.#s,t=(o,a)=>{a.append(o),o.style.width="",o.style.height="",a.classList.remove("selecting")},i=!1;document.addEventListener("pointerdown",()=>{i=!0},{signal:e}),document.addEventListener("pointerup",()=>{i=!1,this.#r.forEach(t)},{signal:e}),window.addEventListener("blur",()=>{i=!1,this.#r.forEach(t)},{signal:e}),document.addEventListener("keyup",()=>{i||this.#r.forEach(t)},{signal:e});var r,s;document.addEventListener("selectionchange",()=>{let o=document.getSelection();if(o.rangeCount===0){this.#r.forEach(t);return}let a=new Set;for(let f=0;f{s===this._optionalContentConfigPromise&&(this.#h.initialOptionalContent=o.hasInitialVisibility)}),e.l10n||this.l10n.translate(this.div)}}#g(e,t){let i=Oj.get(t),r=this.#f[i];if(this.#f[i]=e,r){r.replaceWith(e);return}for(let s=i-1;s>=0;s--){let o=this.#f[s];if(o){o.after(e);return}}this.div.prepend(e)}get renderingState(){return this.#d}set renderingState(e){if(e!==this.#d)switch(this.#d=e,this.#s&&(clearTimeout(this.#s),this.#s=null),e){case Be.PAUSED:this.div.classList.remove("loading");break;case Be.RUNNING:this.div.classList.add("loadingIcon"),this.#s=setTimeout(()=>{this.div.classList.add("loading"),this.#s=null},0);break;case Be.INITIAL:case Be.FINISHED:this.div.classList.remove("loadingIcon","loading");break}}#v(){let{viewport:e}=this;if(this.pdfPage){if(this.#l===e.rotation)return;this.#l=e.rotation}HV(this.div,e,!0,!1)}setPdfPage(e){this._isStandalone&&(this.pageColors?.foreground==="CanvasText"||this.pageColors?.background==="Canvas")&&(this._container?.style.setProperty("--hcm-highlight-filter",e.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),this._container?.style.setProperty("--hcm-highlight-selected-filter",e.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","Highlight"))),this.pdfPage=e,this.pdfPageRotate=e.rotate;let t=(this.rotation+this.pdfPageRotate)%360;this.viewport=e.getViewport({scale:this.scale*Ci.PDF_TO_CSS_UNITS,rotation:t}),this.#v(),this.reset()}destroy(){this.reset(),this.pdfPage?.cleanup()}hasEditableAnnotations(){return!!this.annotationLayer?.hasEditableAnnotations()}get _textHighlighter(){return Sh(this,"_textHighlighter",new sb({pageIndex:this.id-1,eventBus:this.eventBus,findController:this.#r.findController}))}#m(e,t){this.eventBus.dispatch(e,{source:this,pageNumber:this.id,error:t})}#y(){return A(this,null,function*(){let e=null;try{yield this.annotationLayer.render(this.viewport,{structTreeLayer:this.structTreeLayer},"display")}catch(t){console.error(`#renderAnnotationLayer: "${t}".`),e=t}finally{this.#m("annotationlayerrendered",e)}})}#w(){return A(this,null,function*(){let e=null;try{yield this.annotationEditorLayer.render(this.viewport,"display")}catch(t){console.error(`#renderAnnotationEditorLayer: "${t}".`),e=t}finally{this.#m("annotationeditorlayerrendered",e)}})}#C(){return A(this,null,function*(){try{yield this.drawLayer.render("display")}catch(e){console.error(`#renderDrawLayer: "${e}".`)}})}#_(){return A(this,null,function*(){let e=null;try{let t=yield this.xfaLayer.render(this.viewport,"display");t?.textDivs&&this._textHighlighter&&this.#x(t.textDivs)}catch(t){console.error(`#renderXfaLayer: "${t}".`),e=t}finally{this.xfaLayer?.div&&(this.l10n.pause(),this.#g(this.xfaLayer.div,"xfaLayer"),this.l10n.resume()),this.#m("xfalayerrendered",e)}})}#E(){return A(this,null,function*(){if(!this.textLayer)return;let e=null;try{yield this.textLayer.render(this.viewport)}catch(t){if(t instanceof PV)return;console.error(`#renderTextLayer: "${t}".`),e=t}this.#m("textlayerrendered",e),this.#M()})}#M(){return A(this,null,function*(){if(!this.textLayer)return;let e=yield this.structTreeLayer?.render();e&&(this.l10n.pause(),this.structTreeLayer?.addElementsToTextLayer(),this.canvas&&e.parentNode!==this.canvas&&this.canvas.append(e),this.l10n.resume()),this.structTreeLayer?.show()})}#x(e){return A(this,null,function*(){let t=yield this.pdfPage.getTextContent(),i=[];for(let r of t.items)i.push(r.str);this._textHighlighter.setTextMapping(e,i),this._textHighlighter.enable()})}_resetZoomLayer(e=!1){if(!this.zoomLayer)return;let t=this.zoomLayer.firstChild;this.#p.delete(t),t.width=0,t.height=0,e&&this.zoomLayer.remove(),this.zoomLayer=null}reset({keepZoomLayer:e=!1,keepAnnotationLayer:t=!1,keepAnnotationEditorLayer:i=!1,keepXfaLayer:r=!1,keepTextLayer:s=!1}={}){this.cancelRendering({keepAnnotationLayer:t,keepAnnotationEditorLayer:i,keepXfaLayer:r,keepTextLayer:s}),this.renderingState=Be.INITIAL;let o=this.div,a=o.childNodes,l=e&&this.zoomLayer||null,c=t&&this.annotationLayer?.div||null,u=i&&this.annotationEditorLayer?.div||null,d=r&&this.xfaLayer?.div||null,h=s&&this.textLayer?.div||null;for(let f=a.length-1;f>=0;f--){let p=a[f];switch(p){case l:case c:case u:case d:case h:continue}p.remove();let g=this.#f.indexOf(p);g>=0&&(this.#f[g]=null)}o.removeAttribute("data-loaded"),c&&this.annotationLayer.hide(),u&&this.annotationEditorLayer.hide(),d&&this.xfaLayer.hide(),h&&this.textLayer.hide(),this.structTreeLayer?.hide(),l||(this.canvas&&(this.#p.delete(this.canvas),this.canvas.width=0,this.canvas.height=0,delete this.canvas),this._resetZoomLayer())}toggleEditingMode(e){this.hasEditableAnnotations()&&(this.#i=e,this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0}))}update({scale:e=0,rotation:t=null,optionalContentConfigPromise:i=null,drawingDelay:r=-1}){this.scale=e||this.scale,typeof t=="number"&&(this.rotation=t),i instanceof Promise&&(this._optionalContentConfigPromise=i,i.then(o=>{i===this._optionalContentConfigPromise&&(this.#h.initialOptionalContent=o.hasInitialVisibility)})),this.#h.directDrawing=!0;let s=(this.rotation+this.pdfPageRotate)%360;if(this.viewport=this.viewport.clone({scale:this.scale*Ci.PDF_TO_CSS_UNITS,rotation:s}),this.#v(),this._isStandalone&&this._container?.style.setProperty("--scale-factor",this.viewport.scale),this.canvas){let o=!1;if(this.#n){if(this.maxCanvasPixels===0)o=!0;else if(this.maxCanvasPixels>0){let{width:l,height:c}=this.viewport,{sx:u,sy:d}=this.outputScale;o=(Math.floor(l)*u|0)*(Math.floor(c)*d|0)>this.maxCanvasPixels}}let a=r>=0&&r<1e3;if(a||o){if(a&&!o&&this.renderingState!==Be.FINISHED&&(this.cancelRendering({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0,cancelExtraDelay:r}),this.renderingState=Be.FINISHED,this.#h.directDrawing=!1),this.cssTransform({target:this.canvas,redrawAnnotationLayer:!0,redrawAnnotationEditorLayer:!0,redrawXfaLayer:!0,redrawTextLayer:!a,hideTextLayer:a}),a)return;this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!0,timestamp:performance.now(),error:this.#a});return}!this.zoomLayer&&!this.canvas.hidden&&(this.zoomLayer=this.canvas.parentNode,this.zoomLayer.style.position="absolute")}this.zoomLayer&&this.cssTransform({target:this.zoomLayer.firstChild}),this.reset({keepZoomLayer:!0,keepAnnotationLayer:!0,keepAnnotationEditorLayer:!0,keepXfaLayer:!0,keepTextLayer:!0})}cancelRendering({keepAnnotationLayer:e=!1,keepAnnotationEditorLayer:t=!1,keepXfaLayer:i=!1,keepTextLayer:r=!1,cancelExtraDelay:s=0}={}){this.renderTask&&(this.renderTask.cancel(s),this.renderTask=null),this.resume=null,this.textLayer&&(!r||!this.textLayer.div)&&(this.textLayer.cancel(),this.textLayer=null),this.annotationLayer&&(!e||!this.annotationLayer.div)&&(this.annotationLayer.cancel(),this.annotationLayer=null,this._annotationCanvasMap=null),this.structTreeLayer&&!this.textLayer&&(this.structTreeLayer=null),this.annotationEditorLayer&&(!t||!this.annotationEditorLayer.div)&&(this.drawLayer&&(this.drawLayer.cancel(),this.drawLayer=null),this.annotationEditorLayer.cancel(),this.annotationEditorLayer=null),this.xfaLayer&&(!i||!this.xfaLayer.div)&&(this.xfaLayer.cancel(),this.xfaLayer=null,this._textHighlighter?.disable())}cssTransform({target:e,redrawAnnotationLayer:t=!1,redrawAnnotationEditorLayer:i=!1,redrawXfaLayer:r=!1,redrawTextLayer:s=!1,hideTextLayer:o=!1}){if(!e.hasAttribute("zooming")){e.setAttribute("zooming",!0);let{style:l}=e;l.width=l.height=""}let a=this.#p.get(e);if(this.viewport!==a){let l=this.viewport.rotation-a.rotation,c=Math.abs(l),u=1,d=1;if(c===90||c===270){let{width:h,height:f}=this.viewport;u=f/h,d=h/f}e.style.transform=`rotate(${l}deg) scale(${u}, ${d})`}t&&this.annotationLayer&&this.#y(),i&&this.annotationEditorLayer&&(this.drawLayer&&this.#C(),this.#w()),r&&this.xfaLayer&&this.#_(),this.textLayer&&(o?(this.textLayer.hide(),this.structTreeLayer?.hide()):s&&this.#E())}get width(){return this.viewport.width}get height(){return this.viewport.height}getPagePoint(e,t){return this.viewport.convertToPdfPoint(e,t)}#A(e,t=null){return A(this,null,function*(){if(e===this.renderTask&&(this.renderTask=null),t instanceof Uy){this.#a=null;return}if(this.#a=t,this.renderingState=Be.FINISHED,this._resetZoomLayer(!0),this.#h.regularAnnotations=!e.separateAnnots,this.eventBus.dispatch("pagerendered",{source:this,pageNumber:this.id,cssTransform:!1,timestamp:performance.now(),error:this.#a}),t)throw t})}draw(){return A(this,null,function*(){this.renderingState!==Be.INITIAL&&(console.error("Must be in new state before drawing"),this.reset());let{div:e,l10n:t,pageColors:i,pdfPage:r,viewport:s}=this;if(!r)throw this.renderingState=Be.FINISHED,new Error("pdfPage is not loaded");this.renderingState=Be.RUNNING;let o=document.createElement("div");if(o.classList.add("canvasWrapper"),this.#g(o,"canvasWrapper"),!this.textLayer&&this.#o!==$n.DISABLE&&!r.isPureXfa&&(this._accessibilityManager||=new rb,this.textLayer=new Ph({pdfPage:r,highlighter:this._textHighlighter,accessibilityManager:this._accessibilityManager,enablePermissions:this.#o===$n.ENABLE_PERMISSIONS,onAppend:_=>{this.l10n.pause(),this.#g(_,"textLayer"),this.l10n.resume()}})),!this.annotationLayer&&this.#e!==Ai.DISABLE){let{annotationStorage:_,annotationEditorUIManager:C,downloadManager:R,enableScripting:ge,fieldObjectsPromise:he,hasJSActionsPromise:le,linkService:Ee}=this.#r;this._annotationCanvasMap||=new Map,this.annotationLayer=new xh({pdfPage:r,annotationStorage:_,imageResourcesPath:this.imageResourcesPath,renderForms:this.#e===Ai.ENABLE_FORMS,linkService:Ee,downloadManager:R,enableScripting:ge,hasJSActionsPromise:le,fieldObjectsPromise:he,annotationCanvasMap:this._annotationCanvasMap,accessibilityManager:this._accessibilityManager,annotationEditorUIManager:C,onAppend:Ve=>{this.#g(Ve,"annotationLayer")}})}let a=_=>{if(h?.(!1),this.renderingQueue&&!this.renderingQueue.isHighestPriority(this)){this.renderingState=Be.PAUSED,this.resume=()=>{this.renderingState=Be.RUNNING,_()};return}_()},{width:l,height:c}=s,u=document.createElement("canvas");u.setAttribute("role","presentation"),u.hidden=!0;let d=!!(i?.background&&i?.foreground),h=_=>{(!d||_)&&(u.hidden=!1,h=null)};o.append(u),this.canvas=u;let f=u.getContext("2d",{alpha:!1,willReadFrequently:!this.#t}),p=this.outputScale=new UV;if(this.maxCanvasPixels===0){let _=1/this.scale;p.sx*=_,p.sy*=_,this.#n=!0}else if(this.maxCanvasPixels>0){let _=l*c,C=Math.sqrt(this.maxCanvasPixels/_);p.sx>C||p.sy>C?(p.sx=C,p.sy=C,this.#n=!0):this.#n=!1}let g=VD(p.sx),v=VD(p.sy),m=u.width=yh(bh(l*p.sx),g[0]),y=u.height=yh(bh(c*p.sy),v[0]),b=yh(bh(l),g[1]),w=yh(bh(c),v[1]);p.sx=m/b,p.sy=y/w,this.#c!==g[1]&&(e.style.setProperty("--scale-round-x",`${g[1]}px`),this.#c=g[1]),this.#u!==v[1]&&(e.style.setProperty("--scale-round-y",`${v[1]}px`),this.#u=v[1]),this.#p.set(u,s);let E=p.scaled?[p.sx,0,0,p.sy,0,0]:null,S={canvasContext:f,transform:E,viewport:s,annotationMode:this.#e,optionalContentConfigPromise:this._optionalContentConfigPromise,annotationCanvasMap:this._annotationCanvasMap,pageColors:i,isEditing:this.#i},I=this.renderTask=r.render(S);I.onContinue=a;let M=I.promise.then(()=>A(this,null,function*(){h?.(!0),yield this.#A(I),this.structTreeLayer||=new Rh(r,s.rawDims),this.#E(),this.annotationLayer&&(yield this.#y());let{annotationEditorUIManager:_}=this.#r;_&&(this.drawLayer||=new ib({pageIndex:this.id}),yield this.#C(),this.drawLayer.setParent(o),this.annotationEditorLayer||=new eb({uiManager:_,pdfPage:r,l10n:t,structTreeLayer:this.structTreeLayer,accessibilityManager:this._accessibilityManager,annotationLayer:this.annotationLayer?.annotationLayer,textLayer:this.textLayer,drawLayer:this.drawLayer.getDrawLayer(),onAppend:C=>{this.#g(C,"annotationEditorLayer")}}),this.#w())}),_=>(_ instanceof Uy||h?.(!0),this.#A(I,_)));if(r.isPureXfa){if(!this.xfaLayer){let{annotationStorage:_,linkService:C}=this.#r;this.xfaLayer=new Nh({pdfPage:r,annotationStorage:_,linkService:C})}this.#_()}return e.setAttribute("data-loaded",!0),this.eventBus.dispatch("pagerender",{source:this,pageNumber:this.id}),M})}setPageLabel(e){this.pageLabel=typeof e=="string"?e:null,this.div.setAttribute("data-l10n-args",JSON.stringify({page:this.pageLabel??this.id})),this.pageLabel!==null?this.div.setAttribute("data-page-label",this.pageLabel):this.div.removeAttribute("data-page-label")}get thumbnailCanvas(){let{directDrawing:e,initialOptionalContent:t,regularAnnotations:i}=this.#h;return e&&t&&i?this.canvas:null}};function Lj(n){return A(this,null,function*(){let e="",t=e.split("#",1)[0],{info:i,metadata:r,contentDispositionFilename:s,contentLength:o}=yield n.getMetadata();if(!o){let{length:a}=yield n.getDownloadInfo();o=a}return G(x({},i),{baseURL:t,filesize:o,filename:s||VV(e),metadata:r?.getRaw(),authors:r?.get("dc:creator"),numPages:n.numPages,URL:e})})}var ob=class{constructor(e){this._ready=new Promise((t,i)=>{import(e).then(s=>{t(s.QuickJSSandbox())}).catch(i)})}createSandbox(e){return A(this,null,function*(){(yield this._ready).create(e)})}dispatchEventInSandbox(e){return A(this,null,function*(){let t=yield this._ready;setTimeout(()=>t.dispatchEvent(e),0)})}destroySandbox(){return A(this,null,function*(){(yield this._ready).nukeSandbox()})}},ab=class{#e=null;#t=null;#n=null;#i=null;#r=null;#s=null;#l=null;#c=null;#u=!1;#a=null;#d=null;constructor({eventBus:e,externalServices:t=null,docProperties:i=null}){this.#r=e,this.#s=t,this.#n=i}setViewer(e){this.#c=e}setDocument(e){return A(this,null,function*(){if(this.#l&&(yield this.#g()),this.#l=e,!e)return;let[t,i,r]=yield Promise.all([e.getFieldObjects(),e.getCalculationOrderIds(),e.getJSActions()]);if(!t&&!r){yield this.#g();return}if(e!==this.#l)return;try{this.#a=this.#f()}catch(a){console.error(`setDocument: "${a.message}".`),yield this.#g();return}let s=this.#r;this.#i=new AbortController;let{signal:o}=this.#i;s._on("updatefromsandbox",a=>{a?.source===window&&this.#o(a.detail)},{signal:o}),s._on("dispatcheventinsandbox",a=>{this.#a?.dispatchEventInSandbox(a.detail)},{signal:o}),s._on("pagechanging",({pageNumber:a,previous:l})=>{a!==l&&(this.#p(l),this.#h(a))},{signal:o}),s._on("pagerendered",({pageNumber:a})=>{this._pageOpenPending.has(a)&&a===this.#c.currentPageNumber&&this.#h(a)},{signal:o}),s._on("pagesdestroy",()=>A(this,null,function*(){yield this.#p(this.#c.currentPageNumber),yield this.#a?.dispatchEventInSandbox({id:"doc",name:"WillClose"}),this.#e?.resolve()}),{signal:o});try{let a=yield this.#n(e);if(e!==this.#l)return;yield this.#a.createSandbox({objects:t,calculationOrder:i,appInfo:{platform:navigator.platform,language:navigator.language},docInfo:G(x({},a),{actions:r})}),s.dispatch("sandboxcreated",{source:this})}catch(a){console.error(`setDocument: "${a.message}".`),yield this.#g();return}yield this.#a?.dispatchEventInSandbox({id:"doc",name:"Open"}),yield this.#h(this.#c.currentPageNumber,!0),Promise.resolve().then(()=>{e===this.#l&&(this.#u=!0)})})}dispatchWillSave(){return A(this,null,function*(){return this.#a?.dispatchEventInSandbox({id:"doc",name:"WillSave"})})}dispatchDidSave(){return A(this,null,function*(){return this.#a?.dispatchEventInSandbox({id:"doc",name:"DidSave"})})}dispatchWillPrint(){return A(this,null,function*(){if(this.#a){yield this.#d?.promise,this.#d=Promise.withResolvers();try{yield this.#a.dispatchEventInSandbox({id:"doc",name:"WillPrint"})}catch(e){throw this.#d.resolve(),this.#d=null,e}yield this.#d.promise}})}dispatchDidPrint(){return A(this,null,function*(){return this.#a?.dispatchEventInSandbox({id:"doc",name:"DidPrint"})})}get destroyPromise(){return this.#t?.promise||null}get ready(){return this.#u}get _pageOpenPending(){return Sh(this,"_pageOpenPending",new Set)}get _visitedPages(){return Sh(this,"_visitedPages",new Map)}#o(e){return A(this,null,function*(){let t=this.#c,i=t.isInPresentationMode||t.isChangingPresentationMode,{id:r,siblings:s,command:o,value:a}=e;if(!r){switch(o){case"clear":console.clear();break;case"error":console.error(a);break;case"layout":if(!i){let c=cV(a);t.spreadMode=c.spreadMode}break;case"page-num":t.currentPageNumber=a+1;break;case"print":yield t.pagesPromise,this.#r.dispatch("print",{source:this});break;case"println":console.log(a);break;case"zoom":i||(t.currentScaleValue=a);break;case"SaveAs":this.#r.dispatch("download",{source:this});break;case"FirstPage":t.currentPageNumber=1;break;case"LastPage":t.currentPageNumber=t.pagesCount;break;case"NextPage":t.nextPage();break;case"PrevPage":t.previousPage();break;case"ZoomViewIn":i||t.increaseScale();break;case"ZoomViewOut":i||t.decreaseScale();break;case"WillPrintFinished":this.#d?.resolve(),this.#d=null;break}return}if(i&&e.focus)return;delete e.id,delete e.siblings;let l=s?[r,...s]:[r];for(let c of l){let u=document.querySelector(`[data-element-id="${c}"]`);u?u.dispatchEvent(new CustomEvent("updatefromsandbox",{detail:e})):this.#l?.annotationStorage.setValue(c,e)}})}#h(e,t=!1){return A(this,null,function*(){let i=this.#l,r=this._visitedPages;if(t&&(this.#e=Promise.withResolvers()),!this.#e)return;let s=this.#c.getPageView(e-1);if(s?.renderingState!==Be.FINISHED){this._pageOpenPending.add(e);return}this._pageOpenPending.delete(e);let o=A(this,null,function*(){let a=yield r.has(e)?null:s.pdfPage?.getJSActions();i===this.#l&&(yield this.#a?.dispatchEventInSandbox({id:"page",name:"PageOpen",pageNumber:e,actions:a}))});r.set(e,o)})}#p(e){return A(this,null,function*(){let t=this.#l,i=this._visitedPages;if(!this.#e||this._pageOpenPending.has(e))return;let r=i.get(e);r&&(i.set(e,null),yield r,t===this.#l&&(yield this.#a?.dispatchEventInSandbox({id:"page",name:"PageClose",pageNumber:e})))})}#f(){if(this.#t=Promise.withResolvers(),this.#a)throw new Error("#initScripting: Scripting already exists.");return this.#s.createScripting()}#g(){return A(this,null,function*(){if(!this.#a){this.#l=null,this.#t?.resolve();return}this.#e&&(yield Promise.race([this.#e.promise,new Promise(e=>{setTimeout(e,1e3)})]).catch(()=>{}),this.#e=null),this.#l=null;try{yield this.#a.destroySandbox()}catch{}this.#d?.reject(new Error("Scripting destroyed.")),this.#d=null,this.#i?.abort(),this.#i=null,this._pageOpenPending.clear(),this._visitedPages.clear(),this.#a=null,this.#u=!1,this.#t?.resolve()})}},lb=class extends ab{constructor(e){e.externalServices||window.addEventListener("updatefromsandbox",t=>{e.eventBus.dispatch("updatefromsandbox",{source:window,detail:t.detail})}),e.externalServices||={createScripting:()=>new ob(e.sandboxBundleSrc)},e.docProperties||=t=>Lj(t),super(e)}},Fj=3e4,cb=class{constructor(){this.pdfViewer=null,this.pdfThumbnailViewer=null,this.onIdle=null,this.highestPriorityPage=null,this.idleTimeout=null,this.printing=!1,this.isThumbnailViewEnabled=!1,Object.defineProperty(this,"hasViewer",{value:()=>!!this.pdfViewer})}setViewer(e){this.pdfViewer=e}setThumbnailViewer(e){this.pdfThumbnailViewer=e}isHighestPriority(e){return this.highestPriorityPage===e.renderingId}renderHighestPriority(e){this.idleTimeout&&(clearTimeout(this.idleTimeout),this.idleTimeout=null),!this.pdfViewer.forceRendering(e)&&(this.isThumbnailViewEnabled&&this.pdfThumbnailViewer?.forceRendering()||this.printing||this.onIdle&&(this.idleTimeout=setTimeout(this.onIdle.bind(this),Fj)))}getHighestPriority(e,t,i,r=!1){let s=e.views,o=s.length;if(o===0)return null;for(let d=0;do){let d=e.ids;for(let h=1,f=l-a;h{this.renderHighestPriority()}).catch(t=>{t instanceof Uy||console.error(`renderView: "${t}"`)});break}return!0}},dS=10,Ch={FORCE_SCROLL_MODE_PAGE:1e4,FORCE_LAZY_PAGE_INIT:5e3,PAUSE_EAGER_PAGE_INIT:250};function hS(n){return Object.values(Jt).includes(n)&&n!==Jt.DISABLE}var ub=class{#e=new Set;#t=0;constructor(e){this.#t=e}push(e){let t=this.#e;t.has(e)&&t.delete(e),t.add(e),t.size>this.#t&&this.#n()}resize(e,t=null){this.#t=e;let i=this.#e;if(t){let r=i.size,s=1;for(let o of i)if(t.has(o.id)&&(i.delete(o),i.add(o)),++s>r)break}for(;i.size>this.#t;)this.#n()}has(e){return this.#e.has(e)}[Symbol.iterator](){return this.#e.keys()}#n(){let e=this.#e.keys().next().value;e?.destroy(),this.#e.delete(e)}},Oh=class{#e=null;#t=null;#n=null;#i=Jt.NONE;#r=null;#s=Ai.ENABLE_FORMS;#l=null;#c=!1;#u=!1;#a=!1;#d=!1;#o=!1;#h=null;#p=null;#f=null;#g=null;#v=!1;#m=null;#y=!1;#w=0;#C=new ResizeObserver(this.#V.bind(this));#_=null;#E=null;#M=$n.ENABLE;constructor(e){let t="4.8.69";if(qD!==t)throw new Error(`The API version "${qD}" does not match the Viewer version "${t}".`);if(this.container=e.container,this.viewer=e.viewer||e.container.firstElementChild,this.container?.tagName!=="DIV"||this.viewer?.tagName!=="DIV")throw new Error("Invalid `container` and/or `viewer` option.");if(this.container.offsetParent&&getComputedStyle(this.container).position!=="absolute")throw new Error("The `container` must be absolutely positioned.");this.#C.observe(this.container),this.eventBus=e.eventBus,this.linkService=e.linkService||new hl,this.downloadManager=e.downloadManager||null,this.findController=e.findController||null,this.#t=e.altTextManager||null,this.findController&&(this.findController.onIsPageVisible=r=>this._getVisiblePages().ids.has(r)),this._scriptingManager=e.scriptingManager||null,this.#M=e.textLayerMode??$n.ENABLE,this.#s=e.annotationMode??Ai.ENABLE_FORMS,this.#i=e.annotationEditorMode??Jt.NONE,this.#n=e.annotationEditorHighlightColors||null,this.#u=e.enableHighlightFloatingButton===!0,this.#d=e.enableUpdatedAddImage===!0,this.#o=e.enableNewAltTextWhenAddingImage===!0,this.imageResourcesPath=e.imageResourcesPath||"",this.enablePrintAutoRotate=e.enablePrintAutoRotate||!1,this.removePageBorders=e.removePageBorders||!1,this.maxCanvasPixels=e.maxCanvasPixels,this.l10n=e.l10n,this.l10n||=new lo,this.#a=e.enablePermissions||!1,this.pageColors=e.pageColors||null,this.#p=e.mlManager||null,this.#c=e.enableHWA||!1,this.defaultRenderingQueue=!e.renderingQueue,this.defaultRenderingQueue?(this.renderingQueue=new cb,this.renderingQueue.setViewer(this)):this.renderingQueue=e.renderingQueue;let{abortSignal:i}=e;i?.addEventListener("abort",()=>{this.#C.disconnect(),this.#C=null},{once:!0}),this.scroll=nV(this.container,this._scrollUpdate.bind(this),i),this.presentationModeState=so.UNKNOWN,this._resetView(),this.removePageBorders&&this.viewer.classList.add("removePageBorders"),this.#L(),this.eventBus._on("thumbnailrendered",({pageNumber:r,pdfPage:s})=>{let o=this._pages[r-1];this.#e.has(o)||s?.cleanup()}),e.l10n||this.l10n.translate(this.container)}get pagesCount(){return this._pages.length}getPageView(e){return this._pages[e]}getCachedPageViews(){return new Set(this.#e)}get pageViewsReady(){return this._pages.every(e=>e?.pdfPage)}get renderForms(){return this.#s===Ai.ENABLE_FORMS}get enableScripting(){return!!this._scriptingManager}get currentPageNumber(){return this._currentPageNumber}set currentPageNumber(e){if(!Number.isInteger(e))throw new Error("Invalid page number.");this.pdfDocument&&(this._setCurrentPageNumber(e,!0)||console.error(`currentPageNumber: "${e}" is not a valid page.`))}_setCurrentPageNumber(e,t=!1){if(this._currentPageNumber===e)return t&&this.#P(),!0;if(!(0=0&&(t=i+1)}this._setCurrentPageNumber(t,!0)||console.error(`currentPageLabel: "${e}" is not a valid page.`)}get currentScale(){return this._currentScale!==My?this._currentScale:fS}set currentScale(e){if(isNaN(e))throw new Error("Invalid numeric scale.");this.pdfDocument&&this.#T(e,{noScroll:!1})}get currentScaleValue(){return this._currentScaleValue}set currentScaleValue(e){this.pdfDocument&&this.#T(e,{noScroll:!1})}get pagesRotation(){return this._pagesRotation}set pagesRotation(e){if(!gS(e))throw new Error("Invalid pages rotation angle.");if(!this.pdfDocument||(e%=360,e<0&&(e+=360),this._pagesRotation===e))return;this._pagesRotation=e;let t=this._currentPageNumber;this.refresh(!0,{rotation:e}),this._currentScaleValue&&this.#T(this._currentScaleValue,{noScroll:!0}),this.eventBus.dispatch("rotationchanging",{source:this,pagesRotation:e,pageNumber:t}),this.defaultRenderingQueue&&this.update()}get firstPagePromise(){return this.pdfDocument?this._firstPageCapability.promise:null}get onePageRendered(){return this.pdfDocument?this._onePageRenderedCapability.promise:null}get pagesPromise(){return this.pdfDocument?this._pagesCapability.promise:null}get _layerProperties(){let e=this;return Sh(this,"_layerProperties",{get annotationEditorUIManager(){return e.#r},get annotationStorage(){return e.pdfDocument?.annotationStorage},get downloadManager(){return e.downloadManager},get enableScripting(){return!!e._scriptingManager},get fieldObjectsPromise(){return e.pdfDocument?.getFieldObjects()},get findController(){return e.findController},get hasJSActionsPromise(){return e.pdfDocument?.hasJSActions()},get linkService(){return e.linkService}})}#x(e){let t={annotationEditorMode:this.#i,annotationMode:this.#s,textLayerMode:this.#M};return e&&(!e.includes(_h.COPY)&&this.#M===$n.ENABLE&&(t.textLayerMode=$n.ENABLE_PERMISSIONS),e.includes(_h.MODIFY_CONTENTS)||(t.annotationEditorMode=Jt.DISABLE),!e.includes(_h.MODIFY_ANNOTATIONS)&&!e.includes(_h.FILL_INTERACTIVE_FORMS)&&this.#s===Ai.ENABLE_FORMS&&(t.annotationMode=Ai.ENABLE)),t}#A(e){return A(this,null,function*(){if(document.visibilityState==="hidden"||!this.container.offsetParent||this._getVisiblePages().views.length===0)return;let t=Promise.withResolvers(),i=new AbortController;document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&t.resolve()},{signal:typeof AbortSignal.any=="function"?AbortSignal.any([e,i.signal]):e}),yield Promise.race([this._onePageRenderedCapability.promise,t.promise]),i.abort()})}getAllText(){return A(this,null,function*(){let e=[],t=[];for(let i=1,r=this.pdfDocument.numPages;i<=r;++i){if(this.#y)return null;t.length=0;let s=yield this.pdfDocument.getPage(i),{items:o}=yield s.getTextContent();for(let a of o)a.str&&t.push(a.str),a.hasEOL&&t.push(` `);e.push(ul(t.join("")))}return e.join(` `)})}#I(e,t){let i=document.getSelection(),{focusNode:r,anchorNode:s}=i;if(s&&r&&i.containsNode(this.#m)){if(this.#v||e===$n.ENABLE_PERMISSIONS){t.preventDefault(),t.stopPropagation();return}this.#v=!0;let{classList:o}=this.viewer;o.add("copyAll");let a=new AbortController;window.addEventListener("keydown",l=>this.#y=l.key==="Escape",{signal:a.signal}),this.getAllText().then(l=>A(this,null,function*(){l!==null&&(yield navigator.clipboard.writeText(l))})).catch(l=>{console.warn(`Something goes wrong when extracting the text: ${l.message}`)}).finally(()=>{this.#v=!1,this.#y=!1,a.abort(),o.remove("copyAll")}),t.preventDefault(),t.stopPropagation()}}setDocument(e){if(this.pdfDocument&&(this.eventBus.dispatch("pagesdestroy",{source:this}),this._cancelRendering(),this._resetView(),this.findController?.setDocument(null),this._scriptingManager?.setDocument(null),this.#r?.destroy(),this.#r=null),this.pdfDocument=e,!e)return;let t=e.numPages,i=e.getPage(1),r=e.getOptionalContentConfig({intent:"display"}),s=this.#a?e.getPermissions():Promise.resolve(),{eventBus:o,pageColors:a,viewer:l}=this;this.#h=new AbortController;let{signal:c}=this.#h;if(t>Ch.FORCE_SCROLL_MODE_PAGE){console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");let h=this._scrollMode=pe.PAGE;o.dispatch("scrollmodechanged",{source:this,mode:h})}this._pagesCapability.promise.then(()=>{o.dispatch("pagesloaded",{source:this,pagesCount:t})},()=>{});let u=h=>{let f=this._pages[h.pageNumber-1];f&&this.#e.push(f)};o._on("pagerender",u,{signal:c});let d=h=>{h.cssTransform||(this._onePageRenderedCapability.resolve({timestamp:h.timestamp}),o._off("pagerendered",d))};o._on("pagerendered",d,{signal:c}),Promise.all([i,s]).then(([h,f])=>{if(e!==this.pdfDocument)return;this._firstPageCapability.resolve(h),this._optionalContentConfigPromise=r;let{annotationEditorMode:p,annotationMode:g,textLayerMode:v}=this.#x(f);if(v!==$n.DISABLE){let w=this.#m=document.createElement("div");w.id="hiddenCopyElement",l.before(w)}if(typeof AbortSignal.any=="function"&&p!==Jt.DISABLE){let w=p;e.isPureXfa?console.warn("Warning: XFA-editing is not implemented."):hS(w)?(this.#r=new kV(this.container,l,this.#t,o,e,a,this.#n,this.#u,this.#d,this.#o,this.#p),o.dispatch("annotationeditoruimanager",{source:this,uiManager:this.#r}),w!==Jt.NONE&&(w===Jt.STAMP&&this.#p?.loadModel("altText"),this.#r.updateMode(w))):console.error(`Invalid AnnotationEditor mode: ${w}`)}let m=this._scrollMode===pe.PAGE?null:l,y=this.currentScale,b=h.getViewport({scale:y*Ci.PDF_TO_CSS_UNITS});l.style.setProperty("--scale-factor",b.scale),a?.background&&l.style.setProperty("--page-bg-color",a.background),(a?.foreground==="CanvasText"||a?.background==="Canvas")&&(l.style.setProperty("--hcm-highlight-filter",e.filterFactory.addHighlightHCMFilter("highlight","CanvasText","Canvas","HighlightText","Highlight")),l.style.setProperty("--hcm-highlight-selected-filter",e.filterFactory.addHighlightHCMFilter("highlight_selected","CanvasText","Canvas","HighlightText","ButtonText")));for(let w=1;w<=t;++w){let E=new kh({container:m,eventBus:o,id:w,scale:y,defaultViewport:b.clone(),optionalContentConfigPromise:r,renderingQueue:this.renderingQueue,textLayerMode:v,annotationMode:g,imageResourcesPath:this.imageResourcesPath,maxCanvasPixels:this.maxCanvasPixels,pageColors:a,l10n:this.l10n,layerProperties:this._layerProperties,enableHWA:this.#c});this._pages.push(E)}this._pages[0]?.setPdfPage(h),this._scrollMode===pe.PAGE?this.#S():this._spreadMode!==Ct.NONE&&this._updateSpreadMode(),this.#A(c).then(()=>A(this,null,function*(){if(e!==this.pdfDocument)return;if(this.findController?.setDocument(e),this._scriptingManager?.setDocument(e),this.#m&&document.addEventListener("copy",this.#I.bind(this,v),{signal:c}),this.#r&&o.dispatch("annotationeditormodechanged",{source:this,mode:this.#i}),e.loadingParams.disableAutoFetch||t>Ch.FORCE_LAZY_PAGE_INIT){this._pagesCapability.resolve();return}let w=t-1;if(w<=0){this._pagesCapability.resolve();return}for(let E=2;E<=t;++E){let S=e.getPage(E).then(I=>{let M=this._pages[E-1];M.pdfPage||M.setPdfPage(I),--w===0&&this._pagesCapability.resolve()},I=>{console.error(`Unable to get page ${E} to initialize viewer`,I),--w===0&&this._pagesCapability.resolve()});E%Ch.PAUSE_EAGER_PAGE_INIT===0&&(yield S)}})),o.dispatch("pagesinit",{source:this}),e.getMetadata().then(({info:w})=>{e===this.pdfDocument&&w.Language&&(l.lang=w.Language)}),this.defaultRenderingQueue&&this.update()}).catch(h=>{console.error("Unable to initialize viewer",h),this._pagesCapability.reject(h)})}setPageLabels(e){if(this.pdfDocument){e?Array.isArray(e)&&this.pdfDocument.numPages===e.length?this._pageLabels=e:(this._pageLabels=null,console.error("setPageLabels: Invalid page labels.")):this._pageLabels=null;for(let t=0,i=this._pages.length;t=t.previousPageNumber,t.previousPageNumber=e}_scrollUpdate(){this.pagesCount!==0&&this.update()}#R(e,t=null){let{div:i,id:r}=e;if(this._currentPageNumber!==r&&this._setCurrentPageNumber(r),this._scrollMode===pe.PAGE&&(this.#S(),this.update()),!t&&!this.isInPresentationMode){let s=i.offsetLeft+i.clientLeft,o=s+i.clientWidth,{scrollLeft:a,clientWidth:l}=this.container;(this._scrollMode===pe.HORIZONTAL||sa+l)&&(t={left:0,top:0})}pS(i,t),!this._currentScaleValue&&this._location&&(this._location=null)}#N(e){return e===this._currentScale||Math.abs(e-this._currentScale)<1e-15}#D(e,t,{noScroll:i=!1,preset:r=!1,drawingDelay:s=-1,origin:o=null}){if(this._currentScaleValue=t.toString(),this.#N(e)){r&&this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:t});return}this.viewer.style.setProperty("--scale-factor",e*Ci.PDF_TO_CSS_UNITS);let a=s>=0&&s<1e3;this.refresh(!0,{scale:e,drawingDelay:a?s:-1}),a&&(this.#E=setTimeout(()=>{this.#E=null,this.refresh()},s));let l=this._currentScale;if(this._currentScale=e,!i){let c=this._currentPageNumber,u;if(this._location&&!(this.isInPresentationMode||this.isChangingPresentationMode)&&(c=this._location.pageNumber,u=[null,{name:"XYZ"},this._location.left,this._location.top,null]),this.scrollPageIntoView({pageNumber:c,destArray:u,allowNegativeOffset:!0}),Array.isArray(o)){let d=e/l-1,[h,f]=this.containerTopLeft;this.container.scrollLeft+=(o[0]-f)*d,this.container.scrollTop+=(o[1]-h)*d}}this.eventBus.dispatch("scalechanging",{source:this,scale:e,presetValue:r?t:void 0}),this.defaultRenderingQueue&&this.update()}get#b(){return this._spreadMode!==Ct.NONE&&this._scrollMode!==pe.HORIZONTAL?2:1}#T(e,t){let i=parseFloat(e);if(i>0)t.preset=!1,this.#D(i,e,t);else{let r=this._pages[this._currentPageNumber-1];if(!r)return;let s=OD,o=LD;this.isInPresentationMode?(s=o=4,this._spreadMode!==Ct.NONE&&(s*=2)):this.removePageBorders?s=o=0:this._scrollMode===pe.HORIZONTAL&&([s,o]=[o,s]);let a=(this.container.clientWidth-s)/r.width*r.scale/this.#b,l=(this.container.clientHeight-o)/r.height*r.scale;switch(e){case"page-actual":i=1;break;case"page-width":i=a;break;case"page-height":i=l;break;case"page-fit":i=Math.min(a,l);break;case"auto":let c=jD(r)?a:Math.min(l,a);i=Math.min(tV,c);break;default:console.error(`#setScale: "${e}" is an unknown zoom value.`);return}t.preset=!0,this.#D(i,e,t)}}#P(){let e=this._pages[this._currentPageNumber-1];this.isInPresentationMode&&this.#T(this._currentScaleValue,{noScroll:!0}),this.#R(e)}pageLabelToPageNumber(e){if(!this._pageLabels)return null;let t=this._pageLabels.indexOf(e);return t<0?null:t+1}scrollPageIntoView({pageNumber:e,destArray:t=null,allowNegativeOffset:i=!1,ignoreDestinationZoom:r=!1}){if(!this.pdfDocument)return;let s=Number.isInteger(e)&&this._pages[e-1];if(!s){console.error(`scrollPageIntoView: "${e}" is not a valid pageNumber parameter.`);return}if(this.isInPresentationMode||!t){this._setCurrentPageNumber(e,!0);return}let o=0,a=0,l=0,c=0,u,d,h=s.rotation%180!==0,f=(h?s.height:s.width)/s.scale/Ci.PDF_TO_CSS_UNITS,p=(h?s.width:s.height)/s.scale/Ci.PDF_TO_CSS_UNITS,g=0;switch(t[1].name){case"XYZ":o=t[2],a=t[3],g=t[4],o=o!==null?o:0,a=a!==null?a:p;break;case"Fit":case"FitB":g="page-fit";break;case"FitH":case"FitBH":a=t[2],g="page-width",a===null&&this._location?(o=this._location.left,a=this._location.top):(typeof a!="number"||a<0)&&(a=p);break;case"FitV":case"FitBV":o=t[2],l=f,c=p,g="page-height";break;case"FitR":o=t[2],a=t[3],l=t[4]-o,c=t[5]-a;let b=OD,w=LD;this.removePageBorders&&(b=w=0),u=(this.container.clientWidth-b)/l/Ci.PDF_TO_CSS_UNITS,d=(this.container.clientHeight-w)/c/Ci.PDF_TO_CSS_UNITS,g=Math.min(Math.abs(u),Math.abs(d));break;default:console.error(`scrollPageIntoView: "${t[1].name}" is not a valid destination type.`);return}if(r||(g&&g!==this._currentScale?this.currentScaleValue=g:this._currentScale===My&&(this.currentScaleValue=QF)),g==="page-fit"&&!t[4]){this.#R(s);return}let v=[s.viewport.convertToViewportPoint(o,a),s.viewport.convertToViewportPoint(o+l,a+c)],m=Math.min(v[0][0],v[1][0]),y=Math.min(v[0][1],v[1][1]);i||(m=Math.max(m,0),y=Math.max(y,0)),this.#R(s,{left:m,top:y})}_updateLocation(e){let t=this._currentScale,i=this._currentScaleValue,r=parseFloat(i)===t?Math.round(t*1e4)/100:i,s=e.id,o=this._pages[s-1],a=this.container,l=o.getPagePoint(a.scrollLeft-e.x,a.scrollTop-e.y),c=Math.round(l[0]),u=Math.round(l[1]),d=`#page=${s}`;this.isInPresentationMode||(d+=`&zoom=${r},${c},${u}`),this._location={pageNumber:s,scale:r,top:u,left:c,rotation:this._pagesRotation,pdfOpenParams:d}}update(){let e=this._getVisiblePages(),t=e.views,i=t.length;if(i===0)return;let r=Math.max(dS,2*i+1);this.#e.resize(r,e.ids),this.renderingQueue.renderHighestPriority(e);let s=this._spreadMode===Ct.NONE&&(this._scrollMode===pe.PAGE||this._scrollMode===pe.VERTICAL),o=this._currentPageNumber,a=!1;for(let l of t){if(l.percent<100)break;if(l.id===o&&s){a=!0;break}}this._setCurrentPageNumber(a?o:t[0].id),this._updateLocation(e.first),this.eventBus.dispatch("updateviewarea",{source:this,location:this._location})}#F(){let e=this._getVisiblePages(),t=[],{ids:i,views:r}=e;for(let s of r){let{view:o}=s;if(!o.hasEditableAnnotations()){i.delete(o.id);continue}t.push(s)}return t.length===0?null:(this.renderingQueue.renderHighestPriority({first:t[0],last:t.at(-1),views:t,ids:i}),i)}containsElement(e){return this.container.contains(e)}focus(){this.container.focus()}get _isContainerRtl(){return getComputedStyle(this.container).direction==="rtl"}get isInPresentationMode(){return this.presentationModeState===so.FULLSCREEN}get isChangingPresentationMode(){return this.presentationModeState===so.CHANGING}get isHorizontalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollWidth>this.container.clientWidth}get isVerticalScrollbarEnabled(){return this.isInPresentationMode?!1:this.container.scrollHeight>this.container.clientHeight}_getVisiblePages(){let e=this._scrollMode===pe.PAGE?this.#_.pages:this._pages,t=this._scrollMode===pe.HORIZONTAL,i=t&&this._isContainerRtl;return rV({scrollEl:this.container,views:e,sortByVisibility:!0,horizontal:t,rtl:i})}cleanup(){for(let e of this._pages)e.renderingState!==Be.FINISHED&&e.reset()}_cancelRendering(){for(let e of this._pages)e.cancelRendering()}#U(e){return A(this,null,function*(){if(e.pdfPage)return e.pdfPage;try{let t=yield this.pdfDocument.getPage(e.id);return e.pdfPage||e.setPdfPage(t),t}catch(t){return console.error("Unable to get page for page view",t),null}})}#B(e){if(e.first?.id===1)return!0;if(e.last?.id===this.pagesCount)return!1;switch(this._scrollMode){case pe.PAGE:return this.#_.scrollDown;case pe.HORIZONTAL:return this.scroll.right}return this.scroll.down}forceRendering(e){let t=e||this._getVisiblePages(),i=this.#B(t),r=this._spreadMode!==Ct.NONE&&this._scrollMode!==pe.HORIZONTAL,s=this.renderingQueue.getHighestPriority(t,this._pages,i,r);return s?(this.#U(s).then(()=>{this.renderingQueue.renderView(s)}),!0):!1}get hasEqualPageSizes(){let e=this._pages[0];for(let t=1,i=this._pages.length;t{let i=t.pdfPage.getViewport({scale:1}),r=jD(i);if(e===void 0)e=r;else if(this.enablePrintAutoRotate&&r!==e)return{width:i.height,height:i.width,rotation:(i.rotation-90)%360};return{width:i.width,height:i.height,rotation:i.rotation}})}get optionalContentConfigPromise(){return this.pdfDocument?this._optionalContentConfigPromise?this._optionalContentConfigPromise:(console.error("optionalContentConfigPromise: Not initialized yet."),this.pdfDocument.getOptionalContentConfig({intent:"display"})):Promise.resolve(null)}set optionalContentConfigPromise(e){if(!(e instanceof Promise))throw new Error(`Invalid optionalContentConfigPromise: ${e}`);this.pdfDocument&&this._optionalContentConfigPromise&&(this._optionalContentConfigPromise=e,this.refresh(!1,{optionalContentConfigPromise:e}),this.eventBus.dispatch("optionalcontentconfigchanged",{source:this,promise:e}))}get scrollMode(){return this._scrollMode}set scrollMode(e){if(this._scrollMode!==e){if(!sV(e))throw new Error(`Invalid scroll mode: ${e}`);this.pagesCount>Ch.FORCE_SCROLL_MODE_PAGE||(this._previousScrollMode=this._scrollMode,this._scrollMode=e,this.eventBus.dispatch("scrollmodechanged",{source:this,mode:e}),this._updateScrollMode(this._currentPageNumber))}}_updateScrollMode(e=null){let t=this._scrollMode,i=this.viewer;i.classList.toggle("scrollHorizontal",t===pe.HORIZONTAL),i.classList.toggle("scrollWrapped",t===pe.WRAPPED),!(!this.pdfDocument||!e)&&(t===pe.PAGE?this.#S():this._previousScrollMode===pe.PAGE&&this._updateSpreadMode(),this._currentScaleValue&&isNaN(this._currentScaleValue)&&this.#T(this._currentScaleValue,{noScroll:!0}),this._setCurrentPageNumber(e,!0),this.update())}get spreadMode(){return this._spreadMode}set spreadMode(e){if(this._spreadMode!==e){if(!oV(e))throw new Error(`Invalid spread mode: ${e}`);this._spreadMode=e,this.eventBus.dispatch("spreadmodechanged",{source:this,mode:e}),this._updateSpreadMode(this._currentPageNumber)}}_updateSpreadMode(e=null){if(!this.pdfDocument)return;let t=this.viewer,i=this._pages;if(this._scrollMode===pe.PAGE)this.#S();else if(t.textContent="",this._spreadMode===Ct.NONE)for(let r of this._pages)t.append(r.div);else{let r=this._spreadMode-1,s=null;for(let o=0,a=i.length;o=c;l--){let u=s[l],d=s[l+1]-1;if(ud)return d-e}if(t){let l=s[0];if(le)return l-e+1}break}break}case pe.HORIZONTAL:break;case pe.PAGE:case pe.VERTICAL:{if(this._spreadMode===Ct.NONE)break;let i=this._spreadMode-1;if(t&&e%2!==i)break;if(!t&&e%2===i)break;let{views:r}=this._getVisiblePages(),s=t?e-1:e+1;for(let{id:o,percent:a,widthPercent:l}of r)if(o===s){if(a>0&&l===100)return 2;break}break}}return 1}nextPage(){let e=this._currentPageNumber,t=this.pagesCount;if(e>=t)return!1;let i=this._getPageAdvance(e,!1)||1;return this.currentPageNumber=Math.min(e+i,t),!0}previousPage(){let e=this._currentPageNumber;if(e<=1)return!1;let t=this._getPageAdvance(e,!0)||1;return this.currentPageNumber=Math.max(e-t,1),!0}updateScale({drawingDelay:e,scaleFactor:t=null,steps:i=null,origin:r}){if(i===null&&t===null)throw new Error("Invalid updateScale options: either `steps` or `scaleFactor` must be provided.");if(!this.pdfDocument)return;let s=this._currentScale;if(t>0&&t!==1)s=Math.round(s*t*100)/100;else if(i){let o=i>0?kD:1/kD,a=i>0?Math.ceil:Math.floor;i=Math.abs(i);do s=a((s*o).toFixed(2)*10)/10;while(--i>0)}s=Math.max(JF,Math.min(eV,s)),this.#T(s,{noScroll:!1,drawingDelay:e,origin:r})}increaseScale(e={}){this.updateScale(G(x({},e),{steps:e.steps??1}))}decreaseScale(e={}){this.updateScale(G(x({},e),{steps:-(e.steps??1)}))}#L(e=this.container.clientHeight){e!==this.#w&&(this.#w=e,aV.setProperty("--viewer-container-height",`${e}px`))}#V(e){for(let t of e)if(t.target===this.container){this.#L(Math.floor(t.borderBoxSize[0].blockSize)),this.#l=null;break}}get containerTopLeft(){return this.#l||=[this.container.offsetTop,this.container.offsetLeft]}#j(){this.#f?.abort(),this.#f=null,this.#g!==null&&(clearTimeout(this.#g),this.#g=null)}get annotationEditorMode(){return this.#r?this.#i:Jt.DISABLE}set annotationEditorMode({mode:e,editId:t=null,isFromKeyboard:i=!1}){if(!this.#r)throw new Error("The AnnotationEditor is not enabled.");if(this.#i===e)return;if(!hS(e))throw new Error(`Invalid AnnotationEditor mode: ${e}`);if(!this.pdfDocument)return;e===Jt.STAMP&&this.#p?.loadModel("altText");let{eventBus:r}=this,s=()=>{this.#j(),this.#i=e,this.#r.updateMode(e,t,i),r.dispatch("annotationeditormodechanged",{source:this,mode:e})};if(e===Jt.NONE||this.#i===Jt.NONE){let o=e!==Jt.NONE;o||this.pdfDocument.annotationStorage.resetModifiedIds();for(let l of this._pages)l.toggleEditingMode(o);let a=this.#F();if(o&&a){this.#j(),this.#f=new AbortController;let l=AbortSignal.any([this.#h.signal,this.#f.signal]);r._on("pagerendered",({pageNumber:c})=>{a.delete(c),a.size===0&&(this.#g=setTimeout(s,0))},{signal:l});return}}s()}refresh(e=!1,t=Object.create(null)){if(this.pdfDocument){for(let i of this._pages)i.update(t);this.#E!==null&&(clearTimeout(this.#E),this.#E=null),e||this.update()}}},db=class extends Oh{_resetView(){super._resetView(),this._scrollMode=pe.PAGE,this._spreadMode=Ct.NONE}set scrollMode(e){}_updateScrollMode(){}set spreadMode(e){}_updateSpreadMode(){}};var Vj=Fe.AnnotationLayerBuilder,jj=Fe.DownloadManager,Bj=Fe.EventBus,Uj=Fe.FindState,hb=Fe.GenericL10n,Hr=Fe.LinkTarget,fb=Fe.PDFFindController,Hj=Fe.PDFHistory,pb=Fe.PDFLinkService,$j=Fe.PDFPageView,zj=Fe.PDFScriptingManager,gb=Fe.PDFSinglePageViewer,mb=Fe.PDFViewer,Wj=Fe.ProgressBar,Gj=Fe.RenderingStates,qj=Fe.ScrollMode,Yj=Fe.SimpleLinkService,Xj=Fe.SpreadMode,Kj=Fe.StructTreeLayerBuilder,Zj=Fe.TextLayerBuilder,Qj=Fe.XfaLayerBuilder,Jj=Fe.parseQueryString;var e2=["pdfViewerContainer"];function t2(n,e){let t=new n.EventBus;return n2(t,e),t}function n2(n,e){ke(n,"documentload").pipe(xe(e)).subscribe(()=>{let t=document.createEvent("CustomEvent");t.initCustomEvent("documentload",!0,!0,{}),window.dispatchEvent(t)}),ke(n,"pagerendered").pipe(xe(e)).subscribe(({pageNumber:t,cssTransform:i,source:r})=>{let s=document.createEvent("CustomEvent");s.initCustomEvent("pagerendered",!0,!0,{pageNumber:t,cssTransform:i}),r.div.dispatchEvent(s)}),ke(n,"textlayerrendered").pipe(xe(e)).subscribe(({pageNumber:t,source:i})=>{let r=document.createEvent("CustomEvent");r.initCustomEvent("textlayerrendered",!0,!0,{pageNumber:t}),i.textLayerDiv?.dispatchEvent(r)}),ke(n,"pagechanging").pipe(xe(e)).subscribe(({pageNumber:t,source:i})=>{let r=document.createEvent("UIEvents");r.initEvent("pagechanging",!0,!0),r.pageNumber=t,i.container.dispatchEvent(r)}),ke(n,"pagesinit").pipe(xe(e)).subscribe(({source:t})=>{let i=document.createEvent("CustomEvent");i.initCustomEvent("pagesinit",!0,!0,null),t.container.dispatchEvent(i)}),ke(n,"pagesloaded").pipe(xe(e)).subscribe(({pagesCount:t,source:i})=>{let r=document.createEvent("CustomEvent");r.initCustomEvent("pagesloaded",!0,!0,{pagesCount:t}),i.container.dispatchEvent(r)}),ke(n,"scalechange").pipe(xe(e)).subscribe(({scale:t,presetValue:i,source:r})=>{let s=document.createEvent("UIEvents");s.initEvent("scalechange",!0,!0),s.scale=t,s.presetValue=i,r.container.dispatchEvent(s)}),ke(n,"updateviewarea").pipe(xe(e)).subscribe(({location:t,source:i})=>{let r=document.createEvent("UIEvents");r.initEvent("updateviewarea",!0,!0),r.location=t,i.container.dispatchEvent(r)}),ke(n,"find").pipe(xe(e)).subscribe(({source:t,type:i,query:r,phraseSearch:s,caseSensitive:o,highlightAll:a,findPrevious:l})=>{if(t===window)return;let c=document.createEvent("CustomEvent");c.initCustomEvent("find"+i,!0,!0,{query:r,phraseSearch:s,caseSensitive:o,highlightAll:a,findPrevious:l}),window.dispatchEvent(c)}),ke(n,"attachmentsloaded").pipe(xe(e)).subscribe(({attachmentsCount:t,source:i})=>{let r=document.createEvent("CustomEvent");r.initCustomEvent("attachmentsloaded",!0,!0,{attachmentsCount:t}),i.container.dispatchEvent(r)}),ke(n,"sidebarviewchanged").pipe(xe(e)).subscribe(({view:t,source:i})=>{let r=document.createEvent("CustomEvent");r.initCustomEvent("sidebarviewchanged",!0,!0,{view:t}),i.outerContainer.dispatchEvent(r)}),ke(n,"pagemode").pipe(xe(e)).subscribe(({mode:t,source:i})=>{let r=document.createEvent("CustomEvent");r.initCustomEvent("pagemode",!0,!0,{mode:t}),i.pdfViewer.container.dispatchEvent(r)}),ke(n,"namedaction").pipe(xe(e)).subscribe(({action:t,source:i})=>{let r=document.createEvent("CustomEvent");r.initCustomEvent("namedaction",!0,!0,{action:t}),i.pdfViewer.container.dispatchEvent(r)}),ke(n,"presentationmodechanged").pipe(xe(e)).subscribe(({active:t,switchInProgress:i})=>{let r=document.createEvent("CustomEvent");r.initCustomEvent("presentationmodechanged",!0,!0,{active:t,switchInProgress:i}),window.dispatchEvent(r)}),ke(n,"outlineloaded").pipe(xe(e)).subscribe(({outlineCount:t,source:i})=>{let r=document.createEvent("CustomEvent");r.initCustomEvent("outlineloaded",!0,!0,{outlineCount:t}),i.container.dispatchEvent(r)})}function yb(n,e,t){n[e]=t}function pl(){return typeof window>"u"}pl()||yb(ro,"verbosity",Iy.INFOS);typeof Promise.withResolvers>"u"&&window&&(window.Promise.withResolvers=()=>{let n,e;return{promise:new Promise((i,r)=>{n=i,e=r}),resolve:n,reject:e}});var bb=function(n){return n[n.DISABLED=0]="DISABLED",n[n.ENABLED=1]="ENABLED",n[n.ENHANCED=2]="ENHANCED",n}(bb||{}),bS=(()=>{class n{element;ngZone;static CSS_UNITS=96/72;static BORDER_WIDTH=9;pdfViewerContainer;eventBus;pdfLinkService;pdfFindController;pdfViewer;isVisible=!1;_cMapsUrl=typeof ro<"u"?`https://unpkg.com/pdfjs-dist@${al}/cmaps/`:null;_imageResourcesPath=typeof ro<"u"?`https://unpkg.com/pdfjs-dist@${al}/web/images/`:void 0;_renderText=!0;_renderTextMode=bb.ENABLED;_stickToPage=!1;_originalSize=!0;_pdf;_page=1;_zoom=1;_zoomScale="page-width";_rotation=0;_showAll=!0;_canAutoResize=!0;_fitToPage=!1;_externalLinkTarget="blank";_showBorders=!1;lastLoaded;_latestScrolledPage;pageScrollTimeout=null;isInitialized=!1;loadingTask;destroy$=new Se;afterLoadComplete=new oe;pageRendered=new oe;pageInitialized=new oe;textLayerRendered=new oe;onError=new oe;onProgress=new oe;pageChange=new oe(!0);src;set cMapsUrl(t){this._cMapsUrl=t}set page(t){t=parseInt(t,10)||1;let i=t;this._pdf&&(t=this.getValidPageNumber(t)),this._page=t,i!==t&&this.pageChange.emit(t)}set renderText(t){this._renderText=t}set renderTextMode(t){this._renderTextMode=t}set originalSize(t){this._originalSize=t}set showAll(t){this._showAll=t}set stickToPage(t){this._stickToPage=t}set zoom(t){t<=0||(this._zoom=t)}get zoom(){return this._zoom}set zoomScale(t){this._zoomScale=t}get zoomScale(){return this._zoomScale}set rotation(t){if(!(typeof t=="number"&&t%90===0)){console.warn("Invalid pages rotation angle.");return}this._rotation=t}set externalLinkTarget(t){this._externalLinkTarget=t}set autoresize(t){this._canAutoResize=!!t}set fitToPage(t){this._fitToPage=!!t}set showBorders(t){this._showBorders=!!t}static getLinkTarget(t){switch(t){case"blank":return Hr.BLANK;case"none":return Hr.NONE;case"self":return Hr.SELF;case"parent":return Hr.PARENT;case"top":return Hr.TOP}return null}constructor(t,i){if(this.element=t,this.ngZone=i,pl())return;let r,s=al,o=window[`pdfWorkerSrc${s}`];o?r=o:window.hasOwnProperty("pdfWorkerSrc")&&typeof window.pdfWorkerSrc=="string"&&window.pdfWorkerSrc?r=window.pdfWorkerSrc:r=`https://cdn.jsdelivr.net/npm/pdfjs-dist@${s}/legacy/build/pdf.worker.min.mjs`,yb(xy,"workerSrc",r)}ngAfterViewChecked(){if(this.isInitialized)return;let t=this.pdfViewerContainer.nativeElement.offsetParent;if(this.isVisible===!0&&t==null){this.isVisible=!1;return}this.isVisible===!1&&t!=null&&(this.isVisible=!0,setTimeout(()=>{this.initialize(),this.ngOnChanges({src:this.src})}))}ngOnInit(){this.initialize(),this.setupResizeListener()}ngOnDestroy(){this.clear(),this.destroy$.next(),this.loadingTask=null}ngOnChanges(t){if(!(pl()||!this.isVisible)){if("src"in t)this.loadPDF();else if(this._pdf){if(("renderText"in t||"showAll"in t)&&(this.setupViewer(),this.resetPdfDocument()),"page"in t){let{page:i}=t;if(i.currentValue===this._latestScrolledPage)return;this.pdfViewer.scrollPageIntoView({pageNumber:this._page})}this.update()}}}updateSize(){Ae(this._pdf.getPage(this.pdfViewer.currentPageNumber)).pipe(xe(this.destroy$)).subscribe({next:t=>{let i=this._rotation+t.rotate,r=t.getViewport({scale:this._zoom,rotation:i}).width*n.CSS_UNITS,s=this._zoom,o=!0;if(!this._originalSize||this._fitToPage&&r>this.pdfViewerContainer.nativeElement.clientWidth){let a=t.getViewport({scale:1,rotation:i});s=this.getScale(a.width,a.height),o=!this._stickToPage}this.pdfViewer.currentScale=s,o&&this.pdfViewer.scrollPageIntoView({pageNumber:t.pageNumber,ignoreDestinationZoom:!0})}})}clear(){this.loadingTask&&!this.loadingTask.destroyed&&this.loadingTask.destroy(),this._pdf&&(this._latestScrolledPage=0,this._pdf.destroy(),this._pdf=void 0),this.pdfViewer&&this.pdfViewer.setDocument(null),this.pdfLinkService&&this.pdfLinkService.setDocument(null,null),this.pdfFindController&&this.pdfFindController.setDocument(null)}getPDFLinkServiceConfig(){let t=n.getLinkTarget(this._externalLinkTarget);return t?{externalLinkTarget:t}:{}}initEventBus(){this.eventBus=t2(vb,this.destroy$),ke(this.eventBus,"pagerendered").pipe(xe(this.destroy$)).subscribe(t=>{this.pageRendered.emit(t)}),ke(this.eventBus,"pagesinit").pipe(xe(this.destroy$)).subscribe(t=>{this.pageInitialized.emit(t)}),ke(this.eventBus,"pagechanging").pipe(xe(this.destroy$)).subscribe(({pageNumber:t})=>{this.pageScrollTimeout&&clearTimeout(this.pageScrollTimeout),this.pageScrollTimeout=window.setTimeout(()=>{this._latestScrolledPage=t,this.pageChange.emit(t)},100)}),ke(this.eventBus,"textlayerrendered").pipe(xe(this.destroy$)).subscribe(t=>{this.textLayerRendered.emit(t)})}initPDFServices(){this.pdfLinkService=new pb(x({eventBus:this.eventBus},this.getPDFLinkServiceConfig())),this.pdfFindController=new fb({eventBus:this.eventBus,linkService:this.pdfLinkService})}getPDFOptions(){return{eventBus:this.eventBus,container:this.element.nativeElement.querySelector("div"),removePageBorders:!this._showBorders,linkService:this.pdfLinkService,textLayerMode:this._renderText?this._renderTextMode:bb.DISABLED,findController:this.pdfFindController,l10n:new hb("en"),imageResourcesPath:this._imageResourcesPath,annotationEditorMode:Sy.DISABLE}}setupViewer(){this.pdfViewer&&this.pdfViewer.setDocument(null),yb(ro,"disableTextLayer",!this._renderText),this.initPDFServices(),this._showAll?this.pdfViewer=new mb(this.getPDFOptions()):this.pdfViewer=new gb(this.getPDFOptions()),this.pdfLinkService.setViewer(this.pdfViewer),this.pdfViewer._currentPageNumber=this._page}getValidPageNumber(t){return t<1?1:t>this._pdf.numPages?this._pdf.numPages:t}getDocumentParams(){let t=typeof this.src;if(!this._cMapsUrl)return this.src;let i={cMapUrl:this._cMapsUrl,cMapPacked:!0,enableXfa:!0};return i.isEvalSupported=!1,t==="string"?i.url=this.src:t==="object"&&(this.src.byteLength!==void 0?i.data=this.src:Object.assign(i,this.src)),i}loadPDF(){if(!this.src)return;if(this.lastLoaded===this.src){this.update();return}this.clear(),this.setupViewer(),this.loadingTask=Ty(this.getDocumentParams()),this.loadingTask.onProgress=i=>{this.onProgress.emit(i)};let t=this.src;Ae(this.loadingTask.promise).pipe(xe(this.destroy$)).subscribe({next:i=>{this._pdf=i,this.lastLoaded=t,this.afterLoadComplete.emit(i),this.resetPdfDocument(),this.update()},error:i=>{this.lastLoaded=null,this.onError.emit(i)}})}update(){this.page=this._page,this.render()}render(){if(this._page=this.getValidPageNumber(this._page),(this._rotation!==0||this.pdfViewer.pagesRotation!==this._rotation)&&this.pdfViewer.firstPagePromise?.then(()=>this.pdfViewer.pagesRotation=this._rotation),this._stickToPage&&setTimeout(()=>{this.pdfViewer.currentPageNumber=this._page}),this.pdfViewer._pages?.length)this.updateSize();else{let t=this.pageInitialized.subscribe(()=>{this.updateSize(),t.unsubscribe()})}}getScale(t,i){let r=this._showBorders?2*n.BORDER_WIDTH:0,s=this.pdfViewerContainer.nativeElement.clientWidth-r,o=this.pdfViewerContainer.nativeElement.clientHeight-r;if(o===0||i===0||s===0||t===0)return 1;let a=1;switch(this._zoomScale){case"page-fit":a=Math.min(o/i,s/t);break;case"page-height":a=o/i;break;case"page-width":default:a=s/t;break}return this._zoom*a/n.CSS_UNITS}resetPdfDocument(){this.pdfLinkService.setDocument(this._pdf,null),this.pdfFindController.setDocument(this._pdf),this.pdfViewer.setDocument(this._pdf)}initialize(){pl()||!this.isVisible||(this.isInitialized=!0,this.initEventBus(),this.setupViewer())}setupResizeListener(){pl()||this.ngZone.runOutsideAngular(()=>{ke(window,"resize").pipe(wf(100),At(()=>this._canAutoResize&&!!this._pdf),xe(this.destroy$)).subscribe(()=>{this.updateSize()})})}static \u0275fac=function(i){return new(i||n)(j(Lt),j($e))};static \u0275cmp=ye({type:n,selectors:[["pdf-viewer"]],viewQuery:function(i,r){if(i&1&&Kc(e2,5),i&2){let s;Zc(s=Qc())&&(r.pdfViewerContainer=s.first)}},inputs:{src:"src",cMapsUrl:[0,"c-maps-url","cMapsUrl"],page:"page",renderText:[0,"render-text","renderText"],renderTextMode:[0,"render-text-mode","renderTextMode"],originalSize:[0,"original-size","originalSize"],showAll:[0,"show-all","showAll"],stickToPage:[0,"stick-to-page","stickToPage"],zoom:"zoom",zoomScale:[0,"zoom-scale","zoomScale"],rotation:"rotation",externalLinkTarget:[0,"external-link-target","externalLinkTarget"],autoresize:"autoresize",fitToPage:[0,"fit-to-page","fitToPage"],showBorders:[0,"show-borders","showBorders"]},outputs:{afterLoadComplete:"after-load-complete",pageRendered:"page-rendered",pageInitialized:"pages-initialized",textLayerRendered:"text-layer-rendered",onError:"error",onProgress:"on-progress",pageChange:"pageChange"},standalone:!1,features:[si],decls:3,vars:0,consts:[["pdfViewerContainer",""],[1,"ng2-pdf-viewer-container"],[1,"pdfViewer"]],template:function(i,r){i&1&&(k(0,"div",1,0),fe(2,"div",2),N())},styles:[`.ng2-pdf-viewer-container[_ngcontent-%COMP%]{overflow-x:auto;position:absolute;height:100%;width:100%;-webkit-overflow-scrolling:touch}[_nghost-%COMP%]{display:block;position:relative}[_nghost-%COMP%] {--pdfViewer-padding-bottom: 0;--page-margin: 1px auto -8px;--page-border: 9px solid transparent;--spreadHorizontalWrapped-margin-LR: -3.5px;--viewer-container-height: 0;--annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,");--xfa-unfocused-field-background: var( --annotation-unfocused-field-background );--page-border-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAYAAAByUDbMAAAA1ElEQVQ4jbWUWw6EIAxFy2NFs/8NzR4UJhpqLsdi5mOmSSMUOfYWqv3S0gMr4XlYH/64gZa/gN3ANYA7KAXALt4ktoQ5MI9YxqaG8bWmsIysMuT6piSQCa4whZThCu8CM4zP9YJaKci9jicPq3NcBWYoPMGUlhG7ivtkB+gVyFY75wXghOvh8t5mto1Mdim6e+MBqH6XsY+YAwjpq3vGF7weTWQptLEDVCZvPTMl5JZZsdh47FHW6qFMyvLYqjcnmdFfY9Xk/KDOlzCusX2mi/ofM7MPkzBcSp4Q1/wAAAAASUVORK5CYII=) 9 9 repeat;--scale-factor: 1;--focus-outline: solid 2px blue;--hover-outline: dashed 2px blue;--freetext-line-height: 1.35;--freetext-padding: 2px;--editorInk-editing-cursor: pointer}@media screen and (forced-colors: active){[_nghost-%COMP%] {--pdfViewer-padding-bottom: 9px;--page-margin: 8px auto -1px;--page-border: 1px solid CanvasText;--page-border-image: none;--spreadHorizontalWrapped-margin-LR: 3.5px}}@media (forced-colors: active){[_nghost-%COMP%] {--focus-outline: solid 3px ButtonText;--hover-outline: dashed 3px ButtonText}}[_nghost-%COMP%] .textLayer{position:absolute;text-align:initial;inset:0;overflow:hidden;opacity:.2;line-height:1;-webkit-text-size-adjust:none;text-size-adjust:none;forced-color-adjust:none;transform-origin:0 0}[_nghost-%COMP%] .textLayer span, [_nghost-%COMP%] .textLayer br{color:transparent;position:absolute;white-space:pre;cursor:text;transform-origin:0% 0%}[_nghost-%COMP%] .textLayer span.markedContent{top:0;height:0}[_nghost-%COMP%] .textLayer .highlight{margin:-1px;padding:1px;background-color:#b400aa;border-radius:4px}[_nghost-%COMP%] .textLayer .highlight.appended{position:initial}[_nghost-%COMP%] .textLayer .highlight.begin{border-radius:4px 0 0 4px}[_nghost-%COMP%] .textLayer .highlight.end{border-radius:0 4px 4px 0}[_nghost-%COMP%] .textLayer .highlight.middle{border-radius:0}[_nghost-%COMP%] .textLayer .highlight.selected{background-color:#006400}[_nghost-%COMP%] .textLayer ::selection{background:rgb(0,0,255)}[_nghost-%COMP%] .textLayer br::selection{background:transparent}[_nghost-%COMP%] .textLayer .endOfContent{display:block;position:absolute;inset:100% 0 0;z-index:-1;cursor:default;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] .textLayer .endOfContent.active{top:0}@media (forced-colors: active){[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input:required, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea:required, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select:required, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:required, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:required{outline:1.5px solid selectedItem}}[_nghost-%COMP%] .annotationLayer{position:absolute;top:0;left:0;pointer-events:none;transform-origin:0 0}[_nghost-%COMP%] .annotationLayer section{position:absolute;text-align:initial;pointer-events:auto;box-sizing:border-box;transform-origin:0 0}[_nghost-%COMP%] .annotationLayer .linkAnnotation>a, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.pushButton>a{position:absolute;font-size:1em;top:0;left:0;width:100%;height:100%}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.pushButton>canvas{width:100%;height:100%}[_nghost-%COMP%] .annotationLayer .linkAnnotation>a:hover, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.pushButton>a:hover{opacity:.2;background:rgb(255,255,0);box-shadow:0 2px 10px #ff0}[_nghost-%COMP%] .annotationLayer .textAnnotation img{position:absolute;cursor:pointer;width:100%;height:100%}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input{background-image:var(--annotation-unfocused-field-background);border:1px solid transparent;box-sizing:border-box;font:calc(9px * var(--scale-factor)) sans-serif;height:100%;margin:0;vertical-align:top;width:100%}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input:required, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea:required, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select:required, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:required, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:required{outline:1.5px solid red}[_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select option{padding:0}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input{border-radius:50%}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea{resize:none}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input[disabled], [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea[disabled], [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select[disabled], [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input[disabled], [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input[disabled]{background:none;border:1px solid transparent;cursor:not-allowed}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input:hover, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea:hover, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select:hover, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:hover, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:hover{border:1px solid rgb(0,0,0)}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input:focus, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea:focus, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select:focus{background:none;border:1px solid transparent}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input :focus, [_nghost-%COMP%] .annotationLayer .textWidgetAnnotation textarea :focus, [_nghost-%COMP%] .annotationLayer .choiceWidgetAnnotation select :focus, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox :focus, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton :focus{background-image:none;background-color:transparent;outline:auto}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{background-color:CanvasText;content:"";display:block;position:absolute}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{height:80%;left:45%;width:1px}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:before{transform:rotate(45deg)}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input:checked:after{transform:rotate(-45deg)}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input:checked:before{border-radius:50%;height:50%;left:30%;top:20%;width:50%}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input.comb{font-family:monospace;padding-left:2px;padding-right:0}[_nghost-%COMP%] .annotationLayer .textWidgetAnnotation input.comb:focus{width:103%}[_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.checkBox input, [_nghost-%COMP%] .annotationLayer .buttonWidgetAnnotation.radioButton input{-webkit-appearance:none;appearance:none}[_nghost-%COMP%] .annotationLayer .popupTriggerArea{height:100%;width:100%}[_nghost-%COMP%] .annotationLayer .popupWrapper{position:absolute;font-size:calc(9px * var(--scale-factor));width:100%;min-width:calc(180px * var(--scale-factor));pointer-events:none}[_nghost-%COMP%] .annotationLayer .popup{position:absolute;max-width:calc(180px * var(--scale-factor));background-color:#ff9;box-shadow:0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor)) #888;border-radius:calc(2px * var(--scale-factor));padding:calc(6px * var(--scale-factor));margin-left:calc(5px * var(--scale-factor));cursor:pointer;font:message-box;white-space:normal;word-wrap:break-word;pointer-events:auto}[_nghost-%COMP%] .annotationLayer .popup>*{font-size:calc(9px * var(--scale-factor))}[_nghost-%COMP%] .annotationLayer .popup h1{display:inline-block}[_nghost-%COMP%] .annotationLayer .popupDate{display:inline-block;margin-left:calc(5px * var(--scale-factor))}[_nghost-%COMP%] .annotationLayer .popupContent{border-top:1px solid rgb(51,51,51);margin-top:calc(2px * var(--scale-factor));padding-top:calc(2px * var(--scale-factor))}[_nghost-%COMP%] .annotationLayer .richText>*{white-space:pre-wrap;font-size:calc(9px * var(--scale-factor))}[_nghost-%COMP%] .annotationLayer .highlightAnnotation, [_nghost-%COMP%] .annotationLayer .underlineAnnotation, [_nghost-%COMP%] .annotationLayer .squigglyAnnotation, [_nghost-%COMP%] .annotationLayer .strikeoutAnnotation, [_nghost-%COMP%] .annotationLayer .freeTextAnnotation, [_nghost-%COMP%] .annotationLayer .lineAnnotation svg line, [_nghost-%COMP%] .annotationLayer .squareAnnotation svg rect, [_nghost-%COMP%] .annotationLayer .circleAnnotation svg ellipse, [_nghost-%COMP%] .annotationLayer .polylineAnnotation svg polyline, [_nghost-%COMP%] .annotationLayer .polygonAnnotation svg polygon, [_nghost-%COMP%] .annotationLayer .caretAnnotation, [_nghost-%COMP%] .annotationLayer .inkAnnotation svg polyline, [_nghost-%COMP%] .annotationLayer .stampAnnotation, [_nghost-%COMP%] .annotationLayer .fileAttachmentAnnotation{cursor:pointer}[_nghost-%COMP%] .annotationLayer section svg{position:absolute;width:100%;height:100%}[_nghost-%COMP%] .annotationLayer .annotationTextContent{position:absolute;width:100%;height:100%;opacity:0;color:transparent;-webkit-user-select:none;user-select:none;pointer-events:none}[_nghost-%COMP%] .annotationLayer .annotationTextContent span{width:100%;display:inline-block}@media (forced-colors: active){[_nghost-%COMP%] .xfaLayer *:required{outline:1.5px solid selectedItem}}[_nghost-%COMP%] .xfaLayer .highlight{margin:-1px;padding:1px;background-color:#efcbed;border-radius:4px}[_nghost-%COMP%] .xfaLayer .highlight.appended{position:initial}[_nghost-%COMP%] .xfaLayer .highlight.begin{border-radius:4px 0 0 4px}[_nghost-%COMP%] .xfaLayer .highlight.end{border-radius:0 4px 4px 0}[_nghost-%COMP%] .xfaLayer .highlight.middle{border-radius:0}[_nghost-%COMP%] .xfaLayer .highlight.selected{background-color:#cbdfcb}[_nghost-%COMP%] .xfaLayer ::selection{background:rgb(0,0,255)}[_nghost-%COMP%] .xfaPage{overflow:hidden;position:relative}[_nghost-%COMP%] .xfaContentarea{position:absolute}[_nghost-%COMP%] .xfaPrintOnly{display:none}[_nghost-%COMP%] .xfaLayer{position:absolute;text-align:initial;top:0;left:0;transform-origin:0 0;line-height:1.2}[_nghost-%COMP%] .xfaLayer *{color:inherit;font:inherit;font-style:inherit;font-weight:inherit;font-kerning:inherit;letter-spacing:-.01px;text-align:inherit;text-decoration:inherit;box-sizing:border-box;background-color:transparent;padding:0;margin:0;pointer-events:auto;line-height:inherit}[_nghost-%COMP%] .xfaLayer *:required{outline:1.5px solid red}[_nghost-%COMP%] .xfaLayer div{pointer-events:none}[_nghost-%COMP%] .xfaLayer svg{pointer-events:none}[_nghost-%COMP%] .xfaLayer svg *{pointer-events:none}[_nghost-%COMP%] .xfaLayer a{color:#00f}[_nghost-%COMP%] .xfaRich li{margin-left:3em}[_nghost-%COMP%] .xfaFont{color:#000;font-weight:400;font-kerning:none;font-size:10px;font-style:normal;letter-spacing:0;text-decoration:none;vertical-align:0}[_nghost-%COMP%] .xfaCaption{overflow:hidden;flex:0 0 auto}[_nghost-%COMP%] .xfaCaptionForCheckButton{overflow:hidden;flex:1 1 auto}[_nghost-%COMP%] .xfaLabel{height:100%;width:100%}[_nghost-%COMP%] .xfaLeft{display:flex;flex-direction:row;align-items:center}[_nghost-%COMP%] .xfaRight{display:flex;flex-direction:row-reverse;align-items:center}[_nghost-%COMP%] .xfaLeft>.xfaCaption, [_nghost-%COMP%] .xfaLeft>.xfaCaptionForCheckButton, [_nghost-%COMP%] .xfaRight>.xfaCaption, [_nghost-%COMP%] .xfaRight>.xfaCaptionForCheckButton{max-height:100%}[_nghost-%COMP%] .xfaTop{display:flex;flex-direction:column;align-items:flex-start}[_nghost-%COMP%] .xfaBottom{display:flex;flex-direction:column-reverse;align-items:flex-start}[_nghost-%COMP%] .xfaTop>.xfaCaption, [_nghost-%COMP%] .xfaTop>.xfaCaptionForCheckButton, [_nghost-%COMP%] .xfaBottom>.xfaCaption, [_nghost-%COMP%] .xfaBottom>.xfaCaptionForCheckButton{width:100%}[_nghost-%COMP%] .xfaBorder{background-color:transparent;position:absolute;pointer-events:none}[_nghost-%COMP%] .xfaWrapped{width:100%;height:100%}[_nghost-%COMP%] .xfaTextfield:focus, [_nghost-%COMP%] .xfaSelect:focus{background-image:none;background-color:transparent;outline:auto;outline-offset:-1px}[_nghost-%COMP%] .xfaCheckbox:focus, [_nghost-%COMP%] .xfaRadio:focus{outline:auto}[_nghost-%COMP%] .xfaTextfield, [_nghost-%COMP%] .xfaSelect{height:100%;width:100%;flex:1 1 auto;border:none;resize:none;background-image:var(--xfa-unfocused-field-background)}[_nghost-%COMP%] .xfaTop>.xfaTextfield, [_nghost-%COMP%] .xfaTop>.xfaSelect, [_nghost-%COMP%] .xfaBottom>.xfaTextfield, [_nghost-%COMP%] .xfaBottom>.xfaSelect{flex:0 1 auto}[_nghost-%COMP%] .xfaButton{cursor:pointer;width:100%;height:100%;border:none;text-align:center}[_nghost-%COMP%] .xfaLink{width:100%;height:100%;position:absolute;top:0;left:0}[_nghost-%COMP%] .xfaCheckbox, [_nghost-%COMP%] .xfaRadio{width:100%;height:100%;flex:0 0 auto;border:none}[_nghost-%COMP%] .xfaRich{white-space:pre-wrap;width:100%;height:100%}[_nghost-%COMP%] .xfaImage{object-position:left top;object-fit:contain;width:100%;height:100%}[_nghost-%COMP%] .xfaLrTb, [_nghost-%COMP%] .xfaRlTb, [_nghost-%COMP%] .xfaTb{display:flex;flex-direction:column;align-items:stretch}[_nghost-%COMP%] .xfaLr{display:flex;flex-direction:row;align-items:stretch}[_nghost-%COMP%] .xfaRl{display:flex;flex-direction:row-reverse;align-items:stretch}[_nghost-%COMP%] .xfaTb>div{justify-content:left}[_nghost-%COMP%] .xfaPosition{position:relative}[_nghost-%COMP%] .xfaArea{position:relative}[_nghost-%COMP%] .xfaValignMiddle{display:flex;align-items:center}[_nghost-%COMP%] .xfaTable{display:flex;flex-direction:column;align-items:stretch}[_nghost-%COMP%] .xfaTable .xfaRow{display:flex;flex-direction:row;align-items:stretch}[_nghost-%COMP%] .xfaTable .xfaRlRow{display:flex;flex-direction:row-reverse;align-items:stretch;flex:1}[_nghost-%COMP%] .xfaTable .xfaRlRow>div{flex:1}[_nghost-%COMP%] .xfaNonInteractive input, [_nghost-%COMP%] .xfaNonInteractive textarea, [_nghost-%COMP%] .xfaDisabled input, [_nghost-%COMP%] .xfaDisabled textarea, [_nghost-%COMP%] .xfaReadOnly input, [_nghost-%COMP%] .xfaReadOnly textarea{background:initial}@media print{[_nghost-%COMP%] .xfaTextfield, [_nghost-%COMP%] .xfaSelect{background:transparent}[_nghost-%COMP%] .xfaSelect{-webkit-appearance:none;appearance:none;text-indent:1px;text-overflow:""}}[_nghost-%COMP%] [data-editor-rotation="90"]{transform:rotate(90deg)}[_nghost-%COMP%] [data-editor-rotation="180"]{transform:rotate(180deg)}[_nghost-%COMP%] [data-editor-rotation="270"]{transform:rotate(270deg)}[_nghost-%COMP%] .annotationEditorLayer{background:transparent;position:absolute;top:0;left:0;font-size:calc(100px * var(--scale-factor));transform-origin:0 0}[_nghost-%COMP%] .annotationEditorLayer .selectedEditor{outline:var(--focus-outline);resize:none}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor{position:absolute;background:transparent;border-radius:3px;padding:calc(var(--freetext-padding) * var(--scale-factor));resize:none;width:auto;height:auto;z-index:1;transform-origin:0 0;touch-action:none}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .internal{background:transparent;border:none;top:0;left:0;overflow:visible;white-space:nowrap;resize:none;font:10px sans-serif;line-height:var(--freetext-line-height)}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .overlay{position:absolute;display:none;background:transparent;top:0;left:0;width:100%;height:100%}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .overlay.enabled{display:block}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .internal:empty:before{content:attr(default-content);color:gray}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor .internal:focus{outline:none}[_nghost-%COMP%] .annotationEditorLayer .inkEditor.disabled{resize:none}[_nghost-%COMP%] .annotationEditorLayer .inkEditor.disabled.selectedEditor{resize:horizontal}[_nghost-%COMP%] .annotationEditorLayer .freeTextEditor:hover:not(.selectedEditor), [_nghost-%COMP%] .annotationEditorLayer .inkEditor:hover:not(.selectedEditor){outline:var(--hover-outline)}[_nghost-%COMP%] .annotationEditorLayer .inkEditor{position:absolute;background:transparent;border-radius:3px;overflow:auto;width:100%;height:100%;z-index:1;transform-origin:0 0;cursor:auto}[_nghost-%COMP%] .annotationEditorLayer .inkEditor.editing{resize:none;cursor:var(--editorInk-editing-cursor),pointer}[_nghost-%COMP%] .annotationEditorLayer .inkEditor .inkEditorCanvas{position:absolute;top:0;left:0;width:100%;height:100%;touch-action:none}[_nghost-%COMP%] [data-main-rotation="90"]{transform:rotate(90deg) translateY(-100%)}[_nghost-%COMP%] [data-main-rotation="180"]{transform:rotate(180deg) translate(-100%,-100%)}[_nghost-%COMP%] [data-main-rotation="270"]{transform:rotate(270deg) translate(-100%)}[_nghost-%COMP%] .pdfViewer{padding-bottom:var(--pdfViewer-padding-bottom)}[_nghost-%COMP%] .pdfViewer .canvasWrapper{overflow:hidden}[_nghost-%COMP%] .pdfViewer .canvasWrapper canvas{width:100%}[_nghost-%COMP%] .pdfViewer .page{direction:ltr;width:816px;height:1056px;margin:var(--page-margin);position:relative;overflow:visible;border:var(--page-border);border-image:var(--page-border-image);background-clip:content-box;background-color:#fff}[_nghost-%COMP%] .pdfViewer .dummyPage{position:relative;width:0;height:var(--viewer-container-height)}[_nghost-%COMP%] .pdfViewer.removePageBorders .page{margin:0 auto 10px;border:none}[_nghost-%COMP%] .pdfViewer.singlePageView{display:inline-block}[_nghost-%COMP%] .pdfViewer.singlePageView .page{margin:0;border:none}[_nghost-%COMP%] .pdfViewer.scrollHorizontal, [_nghost-%COMP%] .pdfViewer.scrollWrapped, [_nghost-%COMP%] .spread{margin-left:3.5px;margin-right:3.5px;text-align:center}[_nghost-%COMP%] .pdfViewer.scrollHorizontal, [_nghost-%COMP%] .spread{white-space:nowrap}[_nghost-%COMP%] .pdfViewer.removePageBorders, [_nghost-%COMP%] .pdfViewer.scrollHorizontal .spread, [_nghost-%COMP%] .pdfViewer.scrollWrapped .spread{margin-left:0;margin-right:0}[_nghost-%COMP%] .spread .page, [_nghost-%COMP%] .spread .dummyPage, [_nghost-%COMP%] .pdfViewer.scrollHorizontal .page, [_nghost-%COMP%] .pdfViewer.scrollWrapped .page, [_nghost-%COMP%] .pdfViewer.scrollHorizontal .spread, [_nghost-%COMP%] .pdfViewer.scrollWrapped .spread{display:inline-block;vertical-align:middle}[_nghost-%COMP%] .spread .page, [_nghost-%COMP%] .pdfViewer.scrollHorizontal .page, [_nghost-%COMP%] .pdfViewer.scrollWrapped .page{margin-left:var(--spreadHorizontalWrapped-margin-LR);margin-right:var(--spreadHorizontalWrapped-margin-LR)}[_nghost-%COMP%] .pdfViewer.removePageBorders .spread .page, [_nghost-%COMP%] .pdfViewer.removePageBorders.scrollHorizontal .page, [_nghost-%COMP%] .pdfViewer.removePageBorders.scrollWrapped .page{margin-left:5px;margin-right:5px}[_nghost-%COMP%] .pdfViewer .page canvas{margin:0;display:block}[_nghost-%COMP%] .pdfViewer .page canvas[hidden]{display:none}[_nghost-%COMP%] .pdfViewer .page .loadingIcon{position:absolute;display:block;inset:0;background:url(data:image/gif;base64,R0lGODlhGAAYAPQQAM7Ozvr6+uDg4LCwsOjo6I6OjsjIyJycnNjY2KioqMDAwPLy8nZ2doaGhri4uGhoaP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/ilPcHRpbWl6ZWQgd2l0aCBodHRwczovL2V6Z2lmLmNvbS9vcHRpbWl6ZQAh+QQJBwAQACwAAAAAGAAYAAAFmiAkjiTkOGVaBgjZNGSgkgKjjM8zLoI8iy+BKCdiCX8iBeMAhEEIPRXLxViYUE9CbCQoFAzFhHY3zkaT3oPvBz1zE4UBsr1eWZH4vAowOBwGAHk8AoQLfH6Agm0Ed3qOAXWOIgQKiWyFJQgDgJEpdG+WEACNEFNFmKVlVzJQk6qdkwqBoi1mebJ3ALNGeIZHtGSwNDS1RZKueCEAIfkECQcAEAAsAAAAABgAGAAABZcgJI4kpChlWgYCWRQkEKgjURgjw4zOg9CjVwuiEyEeO6CxkBC9nA+HiuUqLEyoBZI0Mx4SAFFgQCDZuguBoGv6Dtg0gvpqdhxQQDkBzuUr/4A1JwMKP39pc2mDhYCIc4GQYn6QCwCMeY91l0p6dBAEJ0OfcFRimZ91Mwt0alxxAIZyRmuAsKxDLKKvZbM1tJxmvGKRpn8hACH5BAkHABAALAAAAAAYABgAAAWhICSOJGQYZVoGAnkcJBKoI3EAY1GMCtPSosSBINKJBIwGkHdwBGGQA0OhYpEGQxNqkYzNIITBACEKKBaxxNfBeOCO4vMy0Hg8nDHFeCktkKtfNAtoS4UqAicKBj9zBAKPC4iKi4aRkISGmWWBmjUIAIyHkCUEAKCVo2WmREecVqoCgZhgP4NHrGWCj7e3szSpuxAsoVWxnp6cVV4kyZW+KSEAIfkECQcAEAAsAAAAABgAGAAABZkgJI4kBABlWgYEOQykEKgjMSDjcYxG0dKi108nEhQKQN4rCIMkCgbawjWYnSCLY2yGVSgEooBhWqsGGwxc0RtNBgoMhmJ1QgETjANYFeBKyUmBKQQIdT9JDmgPDQ6EhoKJD4sOgpWWgiwChyqEBH5hmptSoSOZgJ4kLKWkYTF7C2SaqaM/hEWygay4mYG8t6uffFuzl1iANCEAIfkECQcAEAAsAAAAABgAGAAABZ0gJI4khCBlmhKkopBCoI6LIozDMAIHO4uuBVBnOiR+I4FrCDwAZsKdQnaCLIwwmRUA8JmioprWUCjcwlwUMnAoG0qL03k2KCS8cC0UjOzDCQKBfHQFDAwFU4CCfgqFhy9+kZJWgzSKSAcPZn+BfQENDw8OljGWJAFeDoZPYTBnC1GdSXqnsoBolSulX2GyP6hgvnG0KrS3NJNhuSQhACH5BAkHABAALAAAAAAYABgAAAWaICSOJCQIZZoupGGQRKCOC0CMijIiwz2LABtQZxoMfjQhxAXszWQ7gOwECRhh0MCJJRJARTUoIHFAgbfI6uBwAJS01J/i4PClVYHvfV8lbLlIBmwFbQt+aGmChG18jXeGT4dICQxlb4g/AQUMDER9XjR6BAdiDQwINDBmkAsPDVh4cX4imw53iLKuaVqAcUsPqEiidkt6j4AzIQAh+QQJBwAQACwAAAAAGAAYAAAFmSAkjiREEGWaBiSCtCoZCMsIAKOg1LEo0KKbaKFQ9EYLoOkFuQlirNxzCQkUW9GZ0hQd4nyDAWr4G/esYSbyZFYZwu3jqiuvr8u8I2BwOAwASXh1e31/doeHC3klWnElfAlTd46MfQUGk2stCVEGBQWSdCciDg5VDAVYKoEiDQ0iBwxGcj9RDw8+qHIzebc2DJJQJK6qiKVyIQAh+QQJBwAQACwAAAAAGAAYAAAFmSAkjiS0LGWaBiRBtCoZCKgoCCMB1DF0sz6cCQDo5W62l28XAyZFpyECBv3lnCbhUqHMIo0Qg4Jbmn1jRCa4iV27TzfXGjEecOFWMN1OdvvfPGUuXSoKBw6EXokrAwcHRVU0UAeEBANAAAmUI1gNDyhjJgUHLW0iDg8FIqOnBQZrDA9TELE2rEYIDw4jta2LMpCrqld/YQpgIQAh+QQJBwAQACwAAAAAGAAYAAAFmyAkjiS0LGWaBiRBkKw6BgIqCsJcyyMe4yJajhcEml5H26o1PN2QQd3uFiv2AADlAgflIbDdZLgkABOJgep5LfWty4p4zeU+w+XsvJWXliEKDwdEBgMKYQ4PDw1qK3EDCCMAiQ5BCV0LCj+FSDQkgCgGBiYHAy2MIgoMghAHqw4HAGsNDEMFBTekdgwKI7aRB2MwkL2rVHoQoWchACH5BAkHABAALAAAAAAYABgAAAWWICSOJLQsZZoGJEGQrDoGAioKwlzLIx7jIlqOFwSaXkfbqjU83ZBB3e4WK0qrCxyU55peid0qcUwuixyNx6PhILsAcAJazXYj4lvz2MkLiFsHDAlEcABKZwwMBX8pBgoKQxAIigpBA1sLBj+PSDQkB4uSACYDlTMyBgWDEKVnl2QFBUigN61gBQYjtLV5JZ4jtlR6omMhACH5BAkHABAALAAAAAAYABgAAAWaICSOJLQsZZoGJEGQrDoGAioKwlzLIx7jIlqOFwSaXkdbidYanm7I4AjwYDh6saJuJ3JUG1mZi9srPA7EcRimJLrfJYWZUVC8TziXnEG3u/E+cIJaPAFrPQl1aQAIbRAGBZGHJQiMUQKRBkEKbQsAPZaEXQcslSYKmjMyAAdXj34ACkNEiUgDA5t+PAQHn6Ogjkuzry2DNwhuIQAh+QQFBwAQACwAAAAAGAAYAAAFnCAkjiS0LGVaBgBJEGSguo8zCsK4CPIsMg+ECCcKEH0ix6MwhJl4KiOp8UCdmrEbo6EoHpxF8A6aBBZ6vhf5dmAkkGr0CoWs21WGQ2FvsI9xC3l7B311fy93iWGKJQQOhHCAJQB6A3IqcWwJLU90i2FkUiMKlhBELEI6MwgDXRAGhQgAYD6tTqRFAJxpA6mvrqazSKJJhUWMpjlIIQA7) center no-repeat}[_nghost-%COMP%] .pdfViewer .page .loadingIcon.notVisible{background:none}[_nghost-%COMP%] .pdfViewer.enablePermissions .textLayer span{-webkit-user-select:none!important;user-select:none!important;cursor:not-allowed}[_nghost-%COMP%] .pdfPresentationMode .pdfViewer{padding-bottom:0}[_nghost-%COMP%] .pdfPresentationMode .spread{margin:0}[_nghost-%COMP%] .pdfPresentationMode .pdfViewer .page{margin:0 auto;border:2px solid transparent}`]})}return n})(),wS=(()=>{class n{static \u0275fac=function(i){return new(i||n)};static \u0275mod=Gt({type:n});static \u0275inj=$t({})}return n})();var ES=jS(_S());function r2(n,e){if(n&1&&fe(0,"pdf-viewer",3),n&2){let t=ue(2);W("src",t.byteArr)("render-text",!0)}}function s2(n,e){if(n&1){let t=yn();k(0,"h2",1),ve(1),dt(2,"translate"),N(),k(3,"div",2),Re(4,r2,1,2,"pdf-viewer",3),k(5,"div",4)(6,"button",5),me("click",function(){St(t);let r=ue();return xt(r.saveOrPreview(!1))}),ve(7),dt(8,"translate"),N(),k(9,"button",6),me("click",function(){St(t);let r=ue();return xt(r.saveOrPreview(!0))}),ve(10),dt(11,"translate"),N()()()}if(n&2){let t=ue();V(),Oe(ht(2,4,"search.result.title")),V(3),ut(t.documentUrl?4:-1),V(3),Oe(ht(8,6,"search.result.buttons.preview")),V(3),Oe(ht(11,8,"search.result.buttons.save"))}}function o2(n,e){if(n&1&&fe(0,"dvs-alert-message",0),n&2){let t=ue();W("message",t.alertMessage)}}var Fh=class n{documentUrl;alertMessage="";documentName="Alinma Document";byteArr;themeService=T(zi);ngOnInit(){this.documentUrl&&(this.byteArr=this.convertToByteArray(this.documentUrl))}saveOrPreview(e=!1){this.generateReport({reportBase64:this.documentUrl,extension:"pdf",reportName:this.documentName,print:!e,save:e})}convertToByteArray(e){let t=atob(e),i=new Array(t.length);for(let s=0;se?.body?.response))}getCertificationTypes(e){return this.xhrService.call({method:"GET",endpoint:`public-products/v1/certificates/categories/${e}/types`,category:"api"}).pipe(z(t=>t?.body?.response))}getDynamicFields(e,t){return this.xhrService.call({method:"GET",endpoint:`public-products/v1/certificates/categories/${e}/types/${t}/dynamic-fields`,category:"api"}).pipe(z(i=>i?.body?.response))}search(e){return this.xhrService.call({method:"POST",endpoint:"public-products/v1/certificates/verification",category:"api",body:e}).pipe(z(t=>t?.body?.response),st(t=>(console.error("Error:",t),xi(t?.error?.status?.desc))))}static \u0275fac=function(t){return new(t||n)(F(Ys))};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})};function l2(n,e){if(n&1&&(k(0,"div",9),fe(1,"dvs-search-result",10),N()),n&2){let t=ue();V(),W("documentUrl",t.report)("documentName",t.documentName)("alertMessage",t.error())}}var jh=class n{constructor(e,t){this.translate=e;this.searchService=t}fields=ze([]);isValid=ze(!1);selectedServiceId=ze("");selectedCertId=ze("");dynamicFields=[];error=ze("");reset=ze(!1);report="";documentName="";certificationsTypes=[];searchForm;ngOnInit(){this.getServiceTypes()}createFields(e){this.fields.set([{type:"dropdown",label:this.translate.instant("search.form.labels.serviceType"),index:"serviceType",value:"",required:!0,options:e}])}getServiceTypes(){this.searchService.getServiceTypes().subscribe(e=>{this.createFields(e?.certificationsCategories)})}getCertificationTypes(e){this.searchService.getCertificationTypes(e).subscribe(t=>{t&&(this.certificationsTypes=t?.certificationsTypes,this.fields.update(i=>[...i,{type:"dropdown",label:this.translate.instant("search.form.labels.certificationType"),index:"certificationType",value:"",required:!0,options:t.certificationsTypes}]))})}getDynamicFields(){this.fields.update(e=>e.splice(0,2)),this.searchService.getDynamicFields(this.selectedServiceId(),this.selectedCertId()).subscribe(e=>{this.dynamicFields=e?.dynamicFields,this.fields.update(t=>[...t,...this.dynamicFields||[]])})}onFieldValueChange({value:e,index:t,isValidForm:i}){this.isValid.update(r=>r=i),this.report="",this.error.set(""),t==="serviceType"?(this.selectedServiceId.set(e),this.fields.update(r=>r.splice(0,1)),this.getCertificationTypes(e)):t==="certificationType"?(this.selectedCertId.set(e),this.setDocumentName(),this.selectedServiceId()&&this.selectedCertId()&&this.getDynamicFields()):this.setDynamicFieldValue(e,t)}setDynamicFieldValue(e,t){this.dynamicFields.forEach(i=>{i.index===t&&(i.value=e)})}submit(){if(this.isValid()){this.error.update(t=>t="");let e={certificateType:this.selectedCertId(),dynamicFields:this.prepareDynamicFields()};this.searchService.search(e).subscribe(t=>{this.report=t?.report},t=>{this.error.update(i=>i=t)})}}resetForm(){this.reset.set(!0),this.selectedServiceId.set(""),this.selectedCertId.set(""),this.dynamicFields=[],this.fields.set([]),this.getServiceTypes(),this.error.set(""),this.report="",this.reset.set(!1)}prepareDynamicFields(){return this.dynamicFields.map(t=>({index:t.index||"",value:t.value}))}setDocumentName(){this.documentName=this.certificationsTypes.filter(e=>e.code===this.selectedCertId())[0].desc}static \u0275fac=function(t){return new(t||n)(j(Bn),j(Vh))};static \u0275cmp=ye({type:n,selectors:[["dvs-search-form"]],viewQuery:function(t,i){if(t&1&&Kc(Ba,5),t&2){let r;Zc(r=Qc())&&(i.searchForm=r.first)}},decls:17,vars:13,consts:[[1,"grid","grid-cols-12"],[1,"text-form","col-span-12","sm:col-span-7","mb-0"],[1,"form-hint","text-primaryColor","text-lg","mt-7","mb-3"],[1,"text-error"],[1,"mx-1"],[3,"onAnyChange","fields","reset"],[1,"action-btns","mt-9","mb-4","flex"],["type","button",1,"flex-1","max-w-button","h-button","border","text-xl","min-h-10","rounded-xl","bg-submit","border-submit","text-primaryColor",3,"click","disabled"],["type","button",1,"flex-1","max-w-button","h-button","border","text-xl","min-h-10","ms-3","rounded-xl","bg-transparent","text-primaryColor","border-btnBorder","border-",3,"click"],[1,"col-span-12","mt-8"],[3,"documentUrl","documentName","alertMessage"]],template:function(t,i){t&1&&(k(0,"div",0)(1,"form",1)(2,"div",2)(3,"span",3),ve(4,"*"),N(),k(5,"span",4),ve(6),dt(7,"translate"),N()(),k(8,"dvs-dynamic-form",5),me("onAnyChange",function(s){return i.onFieldValueChange(s)}),N(),k(9,"div",6)(10,"button",7),me("click",function(){return i.submit()}),ve(11),dt(12,"translate"),N(),k(13,"button",8),me("click",function(){return i.resetForm()}),ve(14),dt(15,"translate"),N()()(),Re(16,l2,2,3,"div",9),N()),t&2&&(V(6),Oe(ht(7,7,"search.form.requiredHint")),V(2),W("fields",i.fields())("reset",i.reset()),V(2),W("disabled",!i.isValid()),V(),bn(" ",ht(12,9,"search.form.buttons.search"),""),V(3),Oe(ht(15,11,"search.form.buttons.clear")),V(2),ut(i.error()||i.report?16:-1))},dependencies:[Ba,un,xA,Fh],encapsulation:2})};var Bh=class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ye({type:n,selectors:[["dvs-search"]],decls:6,vars:3,consts:[[1,"p-0"],[1,"d-block","col-span-12","text-2xl","sm:text-5xl","leading-none"]],template:function(t,i){t&1&&(k(0,"dvs-card")(1,"section",0)(2,"h1",1),ve(3),dt(4,"translate"),N(),fe(5,"dvs-search-form"),N()()),t&2&&(V(3),Oe(ht(4,1,"search.title")))},dependencies:[td,jh,un],encapsulation:2})};var CS=(n,e)=>T(Cn).authenticate();var AS=[{path:"landing",component:Pa},{path:"search",component:Bh,resolve:{config:CS}},{path:"**",component:Pa}];var DS=(()=>{class n{http;prefix;suffix;constructor(t,i="/assets/i18n/",r=".json"){this.http=t,this.prefix=i,this.suffix=r}getTranslation(t){return this.http.get(`${this.prefix}${t}${this.suffix}`)}static \u0275fac=function(i){return new(i||n)(F(Li),F(String),F(String))};static \u0275prov=P({token:n,factory:n.\u0275fac})}return n})();var Uh=class n{token="Mocked token";constructor(){}static \u0275fac=function(t){return new(t||n)};static \u0275prov=P({token:n,factory:n.\u0275fac,providedIn:"root"})};var c2=gi.isMock,SS=[{provide:Cn,useClass:c2?Uh:Cn}];var xS=(n,e)=>{let t=T(Ui);if(!["/i18n/"].some(r=>n.url.includes(r))){let r=T(wt),s=T(Cn),o=n.headers.headers&&!n.headers.headers.has("showPageLoader".toLowerCase());o&&t.show();let a=n.clone({setHeaders:{"Accept-Language":r.getCurrentLang(),Authorization:s.token,"Request-Id":Ra()}});return e(a).pipe(Xe(l=>{l.type===di.Response&&o&&t.hide()}),st(l=>{throw o&&t.hide(),l}))}return e(n)};var u2=n=>new DS(n,"./i18n/",".json"),IS={providers:[[...SS],jE({eventCoalescing:!0}),Am(AS),Jg(em([xS])),SA({defaultLanguage:"en",loader:{provide:pi,useFactory:u2,deps:[Li]}})]};var d2=n=>({"relative top-[-5px]":n}),Hh=class n{constructor(e,t){this.themeService=e;this.langService=t;this.currentTheme=this.themeService.getTheme(),this.isLtr=this.langService.isLTR()}isProduction=gi.production?"Production":"Dev";currentTheme="dark";isLtr=!1;toggleTheme(){this.themeService.setTheme(this.currentTheme==="light"?"dark":"light"),this.currentTheme=this.themeService.theme$()}toggleLang(){this.langService.toggleLang()}static \u0275fac=function(t){return new(t||n)(j(zi),j(wt))};static \u0275cmp=ye({type:n,selectors:[["dvs-header"]],decls:12,vars:11,consts:[[1,"col-span-12","bg-appBg","py-4","flex","justify-between","items-center"],[1,"flex","items-center"],[1,"sm:me-6","me-3","w-[165px]","sm:w-full",3,"src"],[1,"bg-transparent","border","min-w-[30px]","w-auto","sm:w-[126px]","h-[30px]","sm:h-button","text-xl","sm:text-2xl","border-accentBtn","text-accentBtn","rounded-lg",3,"click"],[1,"hidden","sm:inline"],[1,"sm:hidden",3,"ngClass"],[1,"w-[115px]","sm:w-full",3,"src"]],template:function(t,i){t&1&&(k(0,"div",0)(1,"div",1),fe(2,"img",2),k(3,"button",3),me("click",function(){return i.toggleLang()}),k(4,"span",4),ve(5),dt(6,"translate"),N(),k(7,"span",5),ve(8),dt(9,"translate"),N()()(),k(10,"div"),fe(11,"img",6),N()()),t&2&&(V(2),W("src","images/"+i.currentTheme+"/dvs-logo.svg",fg),V(3),Oe(ht(6,5,"header.toLang")),V(2),W("ngClass",Jc(9,d2,i.isLtr)),V(),Oe(ht(9,7,"header.toLangMobile")),V(3),W("src","images/"+i.currentTheme+"/alinma-logo.svg",fg))},dependencies:[lt,qt,un],encapsulation:2})};var $h=class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ye({type:n,selectors:[["dvs-footer"]],decls:3,vars:3,consts:[[1,"bg-appBg","py-4","text-center","flex","items-center","justify-center"],[1,"text-footerColor","text-xs/6",3,"innerHTML"]],template:function(t,i){t&1&&(k(0,"div",0),fe(1,"span",1),dt(2,"translate"),N()),t&2&&(V(),W("innerHTML",ht(2,1,"footer.copyrights"),O0))},dependencies:[un],encapsulation:2})};var zh=class n{static \u0275fac=function(t){return new(t||n)};static \u0275cmp=ye({type:n,selectors:[["dvs-page-loader"]],decls:10,vars:0,consts:[[1,"full-loader","flex","justify-center","items-center"],[1,"cube-wrapper"],[1,"cube-container"],[1,"cube","depth"],[1,"front-pane"],[1,"back-pane"],[1,"top-pane"],[1,"bottom-pane"],[1,"left-pane"],[1,"right-pane"]],template:function(t,i){t&1&&(k(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),fe(4,"div",4)(5,"div",5)(6,"div",6)(7,"div",7)(8,"div",8)(9,"div",9),N()()()())},styles:['@-webkit-keyframes _ngcontent-%COMP%_cube-spin{0%{-webkit-transform:rotateY(0)}to{-webkit-transform:rotateY(360deg)}}@-ms-keyframes cube-spin{0%{ms-transform:rotateY(0)}to{ms-transform:rotateY(360deg)}}@keyframes _ngcontent-%COMP%_cube-spin{0%{transform:rotateY(0)}to{transform:rotateY(360deg)}}@-webkit-keyframes _ngcontent-%COMP%_spin-vertical{0%{-webkit-transform:rotateX(0)}to{-webkit-transform:rotateX(-360deg)}}@-ms-keyframes spin-vertical{0%{ms-transform:rotateX(0)}to{ms-transform:rotateX(-360deg)}}@keyframes _ngcontent-%COMP%_spin-vertical{0%{transform:rotateX(0)}to{transform:rotateX(-360deg)}}.cube-container[_ngcontent-%COMP%]{transform:translate(-50%,-50%);position:absolute;left:50%;top:50%;background-color:var(--loader-bg);-webkit-perspective:144px;-webkit-perspective-origin:50% 18px;-moz-perspective:144px;-moz-perspective-origin:50% 18px;-ms-perspective:144px;-ms-perspective-origin:50% 18px;perspective:144px;perspective-origin:50% 18px;height:36px}.cube[_ngcontent-%COMP%]{position:relative;width:36px;margin:0 auto;-webkit-transform-style:preserve-3d;-webkit-animation:_ngcontent-%COMP%_cube-spin 2s infinite linear;-moz-transform-style:preserve-3d;-moz-animation:cube-spin 2s infinite linear;-ms-transform-style:preserve-3d;-ms-animation:cube-spin 2s infinite linear;transform-style:preserve-3d;animation:_ngcontent-%COMP%_cube-spin 2s infinite linear}.cube[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{position:absolute;width:36px;height:36px;text-align:center;line-height:36px;color:var(--loader-bg);font-family:sans-serif;text-transform:uppercase;background:var(--loader-bg);border-radius:10px}.cube[_ngcontent-%COMP%] div.right-pane[_ngcontent-%COMP%]:after, .cube[_ngcontent-%COMP%] div.front-pane[_ngcontent-%COMP%]:after, .cube[_ngcontent-%COMP%] div.back-pane[_ngcontent-%COMP%]:after, .cube[_ngcontent-%COMP%] div.left-pane[_ngcontent-%COMP%]:after{content:"";background:var(--loader-color);width:8px;height:26px;display:block;z-index:999999;position:absolute;top:5px;left:15px;transform:skewY(-15deg)}.depth[_ngcontent-%COMP%] div.back-pane[_ngcontent-%COMP%]{-webkit-transform:translateZ(-18px) rotateY(180deg);-moz-transform:translateZ(-18px) rotateY(180deg);-ms-transform:translateZ(-18px) rotateY(180deg);transform:translateZ(-18px) rotateY(180deg)}.depth[_ngcontent-%COMP%] div.right-pane[_ngcontent-%COMP%]{-webkit-transform:rotateY(-270deg) translateX(18px);-webkit-transform-origin:top right;-moz-transform:rotateY(-270deg) translateX(18px);-moz-transform-origin:top right;-ms-transform:rotateY(-270deg) translateX(18px);-ms-transform-origin:top right;transform:rotateY(-270deg) translate(18px);transform-origin:top right}.depth[_ngcontent-%COMP%] div.left-pane[_ngcontent-%COMP%]{-webkit-transform:rotateY(270deg) translateX(-18px);-webkit-transform-origin:center left;-moz-transform:rotateY(270deg) translateX(-18px);-moz-transform-origin:center left;-ms-transform:rotateY(270deg) translateX(-18px);-ms-transform-origin:center left;transform:rotateY(270deg) translate(-18px);transform-origin:center left}.depth[_ngcontent-%COMP%] div.top-pane[_ngcontent-%COMP%]{-webkit-transform:rotateX(-90deg) translateY(-18px);-webkit-transform-origin:top center;-moz-transform:rotateX(-90deg) translateY(-18px);-moz-transform-origin:top center;-ms-transform:rotateX(-90deg) translateY(-18px);-ms-transform-origin:top center;transform:rotateX(-90deg) translateY(-18px);transform-origin:top center}.depth[_ngcontent-%COMP%] div.bottom-pane[_ngcontent-%COMP%]{-webkit-transform:rotateX(90deg) translateY(18px);-webkit-transform-origin:bottom center;-moz-transform:rotateX(90deg) translateY(18px);-moz-transform-origin:bottom center;-ms-transform:rotateX(90deg) translateY(18px);-ms-transform-origin:bottom center;transform:rotateX(90deg) translateY(18px);transform-origin:bottom center}.depth[_ngcontent-%COMP%] div.front-pane[_ngcontent-%COMP%]{-webkit-transform:translateZ(18px);-moz-transform:translateZ(18px);-ms-transform:translateZ(18px);transform:translateZ(18px)}.cube-wrapper[_ngcontent-%COMP%]{position:fixed}.loader-view-container[_ngcontent-%COMP%]{transform:translate(0);position:relative}.full-loader[_ngcontent-%COMP%]{position:fixed;inset:0;z-index:9999}']})};function h2(n,e){n&1&&fe(0,"dvs-page-loader")}var Wh=class n{constructor(e,t,i,r,s){this.langService=e;this.themeService=t;this.pageLoaderService=i;this.translate=r;this.titleService=s;ki(()=>{this.isPageLoader.update(()=>this.pageLoaderService.isShown())}),this.langService.init(),this.themeService.init()}isPageLoader=ze(!1);ngOnInit(){this.langService.onLangChange.subscribe(e=>{this.translate.get("app.title").subscribe(t=>{this.titleService.setTitle(t)})})}static \u0275fac=function(t){return new(t||n)(j(wt),j(zi),j(Ui),j(Bn),j(_u))};static \u0275cmp=ye({type:n,selectors:[["app-root"]],decls:8,vars:1,consts:[[1,"min-h-screen","grid","grid-rows-[auto_1fr_auto]","grid-cols-12","px-3"],[1,"md:col-start-2","md:col-start-0","col-span-12","md:col-span-10"],[1,"content-wrapper","md:col-start-2","md:col-start-0","col-span-12","md:col-span-10"]],template:function(t,i){t&1&&(Re(0,h2,1,0,"dvs-page-loader"),k(1,"div",0)(2,"header",1),fe(3,"dvs-header"),N(),k(4,"main",2),fe(5,"router-outlet"),N(),k(6,"footer",1),fe(7,"dvs-footer"),N()()),t&2&&ut(i.isPageLoader()?0:-1)},dependencies:[lt,Da,Hh,$h,zh],encapsulation:2})};Yg(Wh,IS).catch(n=>console.error(n));